From d72d4489ccf66ef22128906c8aa3f178b28bb4f3 Mon Sep 17 00:00:00 2001 From: Mark Kaylor Date: Fri, 10 Feb 2023 10:33:34 +0100 Subject: [PATCH] Fix non required json input setting a value when empty --- .../helper-plugin/lib/src/components/GenericInput/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/helper-plugin/lib/src/components/GenericInput/index.js b/packages/core/helper-plugin/lib/src/components/GenericInput/index.js index b7d5b491cd..e63cada7a8 100644 --- a/packages/core/helper-plugin/lib/src/components/GenericInput/index.js +++ b/packages/core/helper-plugin/lib/src/components/GenericInput/index.js @@ -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)}