mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +00:00
Fix non required json input setting a value when empty
This commit is contained in:
parent
f54ae0528b
commit
d72d4489cc
@ -146,8 +146,7 @@ const GenericInput = ({
|
||||
hint={hint}
|
||||
required={required}
|
||||
onChange={(json) => {
|
||||
// Default to null when the field is not required and there is no input value
|
||||
const value = !attribute.required && !json.length ? 'null' : json;
|
||||
const value = !attribute.required && !json.length ? null : json;
|
||||
onChange({ target: { name, value } });
|
||||
}}
|
||||
minHeight={pxToRem(252)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user