Skip to content

Layout: Wide/Fullwidth control disappears when wide/fullwidth option is emptied #71716

@t-hamano

Description

@t-hamano

Description

This is a little difficult to explain, but follow these steps.

First, delete all blocks from the Single Posts template, insert just a Content block, and enable the "Inner blocks use content width" setting.

Image

The template HTML should be like this:

<!-- wp:post-content {"layout":{"type":"constrained"}} /-->

Create a new post, insert a Heading block and save the post. The Heding block has the align control:

Image

Back to the Single Posts template, select the Content block, enter a number in the "Content Width" or "Wide Width" field, then delete them, and save the template.

The template HTML should be like this. Note that the values are added as an empty string.

<!-- wp:post-content {"layout":{"type":"constrained","contentSize":"","wideSize":""}} /-->

Back to the post. The Heading block DON'T have the align control:

Image

If contentSize or wideSize is empty, I think the attribute itself shouldn't be saved.

Step-by-step reproduction instructions

Described above.

Screenshots, screen recording, code snippet

31cce8eca1c6dc334957c37e13f2f2c3.mp4

Environment info

No response

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

    [Feature] LayoutLayout block support, its UI controls, and style output.[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