Skip to content

Commit

Permalink
Fix defaults (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffersonBledsoe authored Nov 30, 2023
1 parent 1ad43f1 commit 2003085
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/customizations/volto-form-block/components/Field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2003085

Please sign in to comment.