defaultValue support for block field config #10493
bratvanov
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Block configs currently don't support a
defaultValue
option.It would be great if block configs behave more like the array field and support
defaultValue
on the same level as thefields
option.The benefits of supporting
defaultValue
in block config might not be immediately obvious in this reduced use-case scenario with only two simple text fields, asdefaultValue
can be added on each of the two text fields. However, this would become very useful ifblocks.fields
contained some more complex nested fields (especially nested array fields). In that scenario,defaultValue
on the block config level would provide a way to automatically start with a complex skeleton of multiple inserted fields whenever a new block is added by providing one largedefaultValue
nested array.Currently, the workaround is to wrap all fields inside
blocks.fields
in a group field, and then provide adefaultValue
for the group field. However, this adds another parent/level of nesting, which might be undesired.Beta Was this translation helpful? Give feedback.
All reactions