close
Skip to content

Centered images broken inside innerBlocks for WordPress 6.2 #49542

@smerriman

Description

@smerriman

Description

For any custom block that uses innerBlocks, when you center an image inside the innerBlocks, it does not appear centered, either in the editor or on the front-end.

Step-by-step reproduction instructions

Install a default theme, e.g. Twenty Twenty-Two.

Add any custom block that uses innerBlocks - for example, the first one here: https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/

Insert the block, then insert an image inside, and attempt to center it. It won't be centered in the editor, nor if you view the result on the front-end.

From an initial inspection, it looks like the CSS for centered images has changed to only center images within is-layout-flow, or something along those lines, which doesn't exist for other blocks.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.2, no Gutenberg plugin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] ImageAffects the Image Block[Block] Media & TextAffects the Media & Text Block[Feature] Nested / Inner BlocksAnything related to the experience of nested/inner blocks inside a larger container, like Group or P[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