Make WordPress Core

Opened 6 months ago

Last modified 6 months ago

#64912 new defect (bug)

Issue with the "layout" node on blocks in theme.json

Reported by: peroks Owned by:
Priority: normal Milestone: Awaiting Review
Component: Editor Version: 6.9.4
Severity: normal Keywords: close
Cc: Focuses:

Description

Actual behaviour in WP 6.9.4, clean install

If you set the "layout" property on a block in theme.json without including the "wideSize" or "contentSize" child properties, the "align" control disappears from all its child blocks, i.e.

"settings": {
	"blocks": {
		"core/group": {
			"layout": {
				"allowCustomContentAndWideSize": false
			}
		}
	},
	...
}

This is also the case when "wideSize" and "contentSize" have been set correctly in the global "layout" settings:

"settings": {
	"layout": {
		"contentSize": "50rem",
		"wideSize": "75rem"
	},
	...
}

Expected behaviour

When "wideSize" or "contentSize" are not included in the block layout node, I would expect the global "wideSize" or "contentSize" layout settings to apply.

In order to remove "wideSize" or "contentSize" layout support for a block, I would expect this to be done explicitly, i.e. "wideSize": false

Today I spent hours figuring out why the "align" control disappeared from all the child blocks in my custom block, where I had disabled "allowCustomContentAndWideSize" (only).

Change History (1)

#1 @poena
6 months ago

  • Component ThemesEditor
  • Keywords close added

Hi
Changes to theme.json are developed and tested in Gutenberg first, so this issue needs to be opened
in the Gutenberg GitHub repository: https://github.com/WordPress/gutenberg

Please search to make sure it hasn't already been reported, before opening new issue.

Note: See TracTickets for help on using tickets.