Problem/Motivation
#3549348: Fatal: Default value for props, on load stores a default for required props when a component is dropped.
Optional props with a schema default get nothing.
The component renders without it, while its form preselects it, see #3506145: Default props values are not used including patterns in twig.
With UI Suite Bootstrap, a dropped Grid 2 columns renders col col, side by side on mobile.
Its form shows 12/12 and 6/6.
Proposed resolution
Also store the default of optional props when a component is dropped.
Only a declared default: an optional prop without one stays empty.
Remaining tasks
- Implement, with a kernel test.
- Check whether the required props path needs the same value conversion.
User interface changes
Newly dropped components render their declared defaults.
Existing instances do not change.
API changes
None.
Data model changes
None.
Issue fork display_builder-3631296
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
mogtofu33 commentedComment #6
pdureau commented