Skip to content

Commit

Permalink
Add default value to checkbox widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
robgietema committed Jan 15, 2025
1 parent 76be8e5 commit ef8f877
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/volto/src/components/manage/Widgets/SchemaWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ map(
[
'Floating-point number',
'label_float_field',
'Yes/No',
'label_boolean_field',
'JSONField',
'Relation Choice',
'Relation List',
Expand All @@ -253,6 +251,19 @@ map(
},
);

map(['Yes/No', 'label_boolean_field'], (factory) => {
config.registerUtility({
name: factory,
type: 'fieldFactoryProperties',
method: (intl) => ({
default: {
type: 'string',
title: intl.formatMessage(messages.defaultValue),
},
}),
});
});

map(['Date/Time', 'label_datetime_field'], (factory) => {
config.registerUtility({
name: factory,
Expand Down

0 comments on commit ef8f877

Please sign in to comment.