Nested group block causes column to wrap subsequent columns

Created on 20 March 2025, 24 days ago

Bug

Layout breaking on frontend when nesting group block inside column.

Steps to reproduce

Add core columns block with 2+ columns. Add core group block inside each column. Save and view page.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States shelaine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @shelaine
  • πŸ‡ΊπŸ‡ΈUnited States shelaine
  • πŸ‡³πŸ‡΄Norway vegardjo

    Looks like this is due to πŸ› Styles missing in frontend for the groups block Active

  • πŸ‡ΊπŸ‡ΈUnited States shelaine

    I'm not sure if its related to the gaps and spacing issue but I have been experiencing those as well. Along with core/group inner width not being applied. For example if I set a group to full width/100% and set the inner width to 1050px the content/inner div still expands 100% width. I've noticed with these styling issues, the styles appear to work upon first saving the page and dissapear after refresh. They are also all stlyes applied to unique class like wp-container-core-columns-layout-1 and these classes dissapear so the styles arent applied. Any styles that are set via classes like has-blue-background-color continue to work. I don't know enough about the style engine to help resolve this.

    For the column absorbing other columns when a group block is present I think it has to do with the group block rendering. I noticed a few things on closer inspection. When core/group is placed inside a core/olumn its causing double

    inside the core/group on the front end. I wonder if this is where the missing closing

    tag is coming from. It's eventually added before the closing of the columns block, essentially wrapping all columns inside the first column. This wrapping behavior applies to the first column you place a group inside of, but doesnt continue wrapping after that.

    For example if I place a group inside the first column, the first column will wrap all columns that come after. If I place a group inside the 2nd column and no group in the first, the wrapping will start with the second column. Seems to have everything to do with some funny behavior from the group block.

    <!-- this column ends up wrapping the others, only happens with a group is inside the column block -->
    <!-- extra inner-contiainer added -->

    test

    <!-- missing cwp-block-column closing div tag --><!-- the next columns/groups wrap correctly -->
    <!-- extra inner-contiainer added -->

    test

    <!-- missing closing div tag shows up here -->
  • πŸ‡ΊπŸ‡ΈUnited States shelaine

    I'm not sure if its related to the gaps and spacing issue but I have been experiencing those as well. Along with core/group inner width not being applied. For example if I set a group to full width/100% and set the inner width to 1050px the content/inner div still expands 100% width. I've noticed with these styling issues, the styles appear to work upon first saving the page and dissapear after refresh. They are also all stlyes applied to unique class like wp-container-core-columns-layout-1 and these classes dissapear so the styles arent applied. Any styles that are set via classes like has-blue-background-color continue to work. I don't know enough about the style engine to help resolve this.

    For the column absorbing other columns when a group block is present I think it has to do with the group block rendering. I noticed a few things on closer inspection. When core/group is placed inside a core/olumn its causing double

    inside the core/group on the front end. I wonder if this is where the missing closing

    tag is coming from. It's eventually added before the closing of the columns block, essentially wrapping all columns inside the first column. This wrapping behavior applies to the first column you place a group inside of, but doesnt continue wrapping after that.

    For example if I place a group inside the first column, the first column will wrap all columns that come after. If I place a group inside the 2nd column and no group in the first, the wrapping will start with the second column. Seems to have everything to do with some funny behavior from the group block.

    <div class="wp-block-columns is-layout-flex wp-container-core-columns-layout-1 wp-block-columns-is-layout-flex">
        
        <!-- this column ends up wrapping the others, only happens with a group is inside the column block -->
        <div class="wp-block-column has-medium-blue-background-color has-background is-layout-flow wp-block-column-is-layout-flow" style="padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)">
            <div class="wp-block-group has-medium-blue-color has-light-grey-background-color has-text-color has-background has-link-color is-layout-constrained wp-block-group-is-layout-constrained">
                <div class="wp-block-group__inner-container">
                    <div class="wp-block-group__inner-container">
                        <div class="wp-block-group__inner-container"> <!-- extra inner-contiainer added -->
                            <div class="wp-block-descartes-heading level-h2">
                                <h2 class="">test</h2>
                            </div>
                        </div>
                    </div>
                 </div>
            </div> 
        <!-- missing cwp-block-column closing div tag -->
    
            <!-- the next columns/groups wrap correctly -->
            <div class="wp-block-column has-blue-background-color has-background is-layout-flow wp-block-column-is-layout-flow" style="padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)">
                <div class="wp-block-group has-medium-blue-color has-light-grey-background-color has-text-color has-background has-link-color is-layout-constrained wp-block-group-is-layout-constrained">
                    <div class="wp-block-group__inner-container">
                        <div class="wp-block-group__inner-container"> <!-- extra inner-contiainer added -->
                            <div class="wp-block-descartes-heading level-h2">
                                <h2 class="">test</h2>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
    
        </div> <!-- missing closing div tag shows up here -->
    
    </div>
Production build 0.71.5 2024