Make WordPress Core

Opened 7 months ago

Closed 5 months ago

#65101 closed defect (bug) (fixed)

Ensure layout classnames are applied to the inner blocks wrapper and not to its siblings

Reported by: isabel_brison Owned by: isabel_brison
Priority: normal Milestone: 7.1
Component: Editor Version:
Severity: normal Keywords: gutenberg-merge has-patch has-unit-tests
Cc: Focuses:

Description

The fix for layout classname application in ​https://github.com/WordPress/gutenberg/pull/77408 needs syncing to core.

Change History (5)

This ticket was mentioned in ​PR #11598 on ​WordPress/wordpress-develop by ​@isabel_brison.


7 months ago
#1

  • Keywords has-patch has-unit-tests added

#2 @darshitrajyaguru97
7 months ago

Patch Testing

I tested the provided patch locally and verified the behavior.

Environment

  • WordPress: 7.0 RC2
  • PHP: 8.3
  • Server: Nginx
  • Browser: Chrome
  • OS: Windows 11

Testing Steps

  1. Applied the patch from this ticket.
  2. Created Group blocks with layout settings (flex, constrained, etc.).
  3. Added nested blocks and sibling blocks.
  4. Inspected DOM output.

Results

  • Layout classnames are now correctly applied only to the inner blocks wrapper.
  • No class leakage to sibling elements observed.
  • Nested block structures behave as expected.

Unit Tests

  • All existing and added tests pass successfully.

Notes

Patch looks good to me

#3 @tusharaddweb
7 months ago

Tested the patch and confirmed that layout classnames are now correctly applied to the inner blocks wrapper instead of sibling elements.

This improves layout consistency and fixes styling issues with block themes using theme.json layout settings.

No regressions observed in my testing.

#4 @gaurangsondagar
7 months ago

Patch Testing Report

Tested the patch: ​https://github.com/WordPress/gutenberg/pull/77408

Environment:

  • WordPress: 7.0-RC2-62242
  • PHP: 8.2.29
  • Server: Apache
  • Database: MySQL
  • Browser: Chrome 146.0.7680.164
  • OS: Ubuntu 22.04.5 LTS

I tested the things as follow:

  • Implemented the patch provided in this ticket
  • Set up Group blocks using different layout configurations
  • Included both nested and sibling blocks in the structure and validate the results

Results:
The applied patch is working as expected.

#5 @isabel_brison
5 months ago

  • Owner set to isabel_brison
  • Resolution → fixed
  • Status new → closed

In 62504:

Editor: ensure layout classnames are applied to the inner blocks wrapper.

Checks that the element classnames get added to doesn’t have a closing tag before the inner blocks start.

Props isabel_brison, andrewserong, @darshitrajyaguru97, @tusharaddweb, @gaurangsondagar.
Fixes #65101.

Note: See TracTickets for help on using tickets.