defaultValue support for block field config #10493
Replies: 1 comment
-
My previous remark has been somewhat mitigated in Payload v3.38.0 due to the addition of #12318 which Therefore, now the workaround for wrapping many fields inside a group field in order to provide a single large That said, eventually adding |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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