Skip to content

Grid Block - (Layout "Auto") breaks the grid when the parent is "Stacked" or "Row" #65537

@ZafarKamal123

Description

@ZafarKamal123

Description

Grid block is not working as expected when inserted inside the "Stack" (or "Row") container when the layout type is "auto".

CleanShot.2024-09-20.at.10.06.55.mp4

Step-by-step reproduction instructions

  1. Navigate to any page/post block editor.
  2. Insert a "Stack" block.
  3. Add a grid block inside the stacked block.
  4. Set the "Layout" to "auto" in grid.

Screenshots, screen recording, code snippet

Here's a simple layout that does not work as expected:

<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap","orientation":"horizontal","justifyContent":"left"}} -->
<div class="wp-block-group"><!-- wp:group {"style":{"spacing":{"blockGap":"0"}},"layout":{"type":"grid","columnCount":null,"minimumColumnWidth":"12rem"}} -->
<div class="wp-block-group"><!-- wp:paragraph {"align":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|base"}}}},"backgroundColor":"contrast","textColor":"base"} -->
<p class="has-text-align-center has-base-color has-contrast-background-color has-text-color has-background has-link-color">1</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|base"}}}},"backgroundColor":"contrast","textColor":"base"} -->
<p class="has-text-align-center has-base-color has-contrast-background-color has-text-color has-background has-link-color">2</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|base"}}}},"backgroundColor":"contrast","textColor":"base"} -->
<p class="has-text-align-center has-base-color has-contrast-background-color has-text-color has-background has-link-color">3</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->

Environment info

  • WordPress version: 6.6.2
  • Gutenberg Plugin: 19.2.0
  • Browser: Chrome
  • OS: MacOS

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

    [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