Skip to content

Cannot align inner blocks in flex layout when allowSwitching is set to true #67016

@metropoliscreative

Description

@metropoliscreative

Description

When a block has layout support and the allowSwitching subproperty is set to true, the vertical alignment setting should be displayed in the block toolbar when the layout is set to flex. The alignment setting is not shown unless allowSwitching is set to false (the default) and flex is the default layout type.

Step-by-step reproduction instructions

Create a block with layout support and allowSwitching set to true

Screenshots, screen recording, code snippet

This is the code that prevents the alignment button from being added to the block toolbar when allowSwitching is set to true:

if ( layoutBlockSupport?.allowSwitching ) {
return null;
}

Environment info

WordPress 6.7, Gutenberg plugin not active

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