Fix non required json input setting a value when empty

This commit is contained in:
Mark Kaylor 2023-02-10 10:33:34 +01:00
parent f54ae0528b
commit d72d4489cc

View File

@ -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)}