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.

Command icon 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

mogtofu33 created an issue. See original summary.

  • mogtofu33 committed f1790fd9 on 1.0.x
    fix: #3631296 Dropped components ignore the schema default of optional...
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Status: Fixed » Closed (fixed)