Skip to content

Group Block: Missing default block gap when they are inside other blocks #39355

@iamtakashi

Description

@iamtakashi

Description

It seems the default block gap is missing when they are inside other blocks such as a Column, a Media & Text, and a Cover block. I expected to have the same gap regardless of the location.

This is happening in both the editor and the front of the site. I've tested with Twenty Twenty Two and Blockbase and it doesn't seem related to the themes.

Step-by-step reproduction instructions

  1. Add a few group blocks
  2. Add some paragraphs inside the group blocks
  3. (Bonus) Add a border to each group block to help see the issue
  4. Copy all the group blocks and put them in a column block

Feel free to use the snippet to test the case.

Screenshots, screen recording, code snippet

<!-- wp:heading {"style":{"spacing":{"margin":{"top":"0px"}}}} -->
<h2 style="margin-top:0px">Groups</h2>
<!-- /wp:heading -->

<!-- wp:group {"style":{"border":{"width":"1px","style":"solid"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-style:solid;border-width:1px"><!-- wp:paragraph -->
<p><strong>Poetry</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Even before the advent of printing, the visual appearance of poetry often added meaning or depth.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"border":{"width":"1px","style":"solid"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-style:solid;border-width:1px"><!-- wp:paragraph -->
<p><strong><strong>Poetry</strong></strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Even before the advent of printing, the visual appearance of poetry often added meaning or depth.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"border":{"width":"1px","style":"solid"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-style:solid;border-width:1px"><!-- wp:paragraph -->
<p><strong><strong>Poetry</strong></strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Even before the advent of printing, the visual appearance of poetry often added meaning or depth.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://images.unsplash.com/photo-1646904043595-5c3f6b0fe13b?ixlib=rb-1.2.1&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=2848&amp;q=80" alt=""/></figure>
<!-- /wp:image --></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:heading {"style":{"spacing":{"margin":{"top":"0px"}}}} -->
<h2 style="margin-top:0px">Groups inside a column</h2>
<!-- /wp:heading -->

<!-- wp:group {"style":{"border":{"width":"1px","style":"solid"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-style:solid;border-width:1px"><!-- wp:paragraph -->
<p><strong><strong>Poetry</strong></strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"left"} -->
<p class="has-text-align-left">Even before the advent of printing, the visual appearance of poetry often added meaning or depth.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"border":{"width":"1px","style":"solid"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-style:solid;border-width:1px"><!-- wp:paragraph -->
<p><strong><strong>Poetry</strong></strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Even before the advent of printing, the visual appearance of poetry often added meaning or depth.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:group {"style":{"border":{"width":"1px","style":"solid"}},"borderColor":"vivid-red"} -->
<div class="wp-block-group has-border-color has-vivid-red-border-color" style="border-style:solid;border-width:1px"><!-- wp:paragraph -->
<p><strong><strong>Poetry</strong></strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Even before the advent of printing, the visual appearance of poetry often added meaning or depth.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

Editor
Screenshot 2022-03-10 at 15 16 13

Front of the site
Screenshot 2022-03-10 at 15 16 28

Environment info

  • V5.9.1.
  • With the Gutenberg 12.8.0-rc.1
  • Twenty Twenty Two, Blockbase
  • Chrome, Mac

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] ColumnsAffects the Columns Block[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