From 2003085f532d5f08c86e7e02e8796d9367e3e4b0 Mon Sep 17 00:00:00 2001 From: Jefferson Bledsoe Date: Thu, 30 Nov 2023 00:02:49 +0000 Subject: [PATCH] Fix defaults (#183) --- src/customizations/volto-form-block/components/Field.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/customizations/volto-form-block/components/Field.jsx b/src/customizations/volto-form-block/components/Field.jsx index aa078a9..81eaebb 100644 --- a/src/customizations/volto-form-block/components/Field.jsx +++ b/src/customizations/volto-form-block/components/Field.jsx @@ -54,7 +54,11 @@ const Field = (props) => { } = props; let { value } = props; // A value of `null` is a touched field with no value - if (typeof props.default_value === "boolean" && value !== null && value === undefined) { + if ( + Object.hasOwn(props, 'default_value') && + value !== null && + value === undefined + ) { value = props.default_value; } const intl = useIntl();