Skip to content

Saving a spacer block without a height value causes a block validation error #68817

@carolinan

Description

@carolinan

Description

If you delete the value of the height option and save, and then refresh the page (or leave and return to edit the content later), there is a block validation error.

I only tested this with block themes that have a theme.json. I tested with the default spacing presets and with custom presets.

When there is a custom spacing preset that uses clamp, like in Twenty Twenty-Five, there is one more issue.
If you select a spacing preset, then toggle the "use size preset" button so that the size input and unit input options show again, and then change the unit but not the size, then the size is also missing and the same block validation error shows.

Step-by-step reproduction instructions

Insert a spacer block.
Delete the value of the height option and save, and then refresh the page.

Screenshots, screen recording, code snippet

A spacer block without a height, with a block validation error showing.

Environment info

WordPress 6.7.1 with and without Gutenberg trunk.

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] SpacerAffects the Spacer Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions