mirror of
https://github.com/strapi/strapi.git
synced 2025-11-08 22:32:02 +00:00
fix(EditViewDataManagerProvider): allow to reset number input
Previously, deleting the numeric value from a number input would send an empty string to the backend. The backend would convert that empty string to 0, meaning that after setting a number, it would be impossible to reset it to an empty field. Signed-off-by: Pablo Rodríguez Caballero <pablo@rodriguezcaballero.me>
This commit is contained in:
parent
0f3fd09a1c
commit
e1549e7612
@ -203,6 +203,11 @@ const EditViewDataManagerProvider = ({
|
|||||||
inputValue = null;
|
inputValue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow to reset number input
|
||||||
|
if (type === 'number' && value === '') {
|
||||||
|
inputValue = null;
|
||||||
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'ON_CHANGE',
|
type: 'ON_CHANGE',
|
||||||
keys: name.split('.'),
|
keys: name.split('.'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user