Skip to content

Update styles to prevent overflow of content inside group block with flex layout#69934

Closed
Debarghya-Banerjee wants to merge 1 commit intoWordPress:trunkfrom
Debarghya-Banerjee:fix/50059-content-overflow-in-group-block
Closed

Update styles to prevent overflow of content inside group block with flex layout#69934
Debarghya-Banerjee wants to merge 1 commit intoWordPress:trunkfrom
Debarghya-Banerjee:fix/50059-content-overflow-in-group-block

Conversation

@Debarghya-Banerjee
Copy link
Copy Markdown
Contributor

What?

Fixes #50059

This PR ensures that long unbroken text (like URLs or long words) inside .is-layout-flex row layout blocks does not cause horizontal overflow on narrow viewports. It adds consistent text-wrapping behavior to match what is already applied to column layouts.

Why?

Currently, if a row layout block contains children with unbroken content (like long links or words), it can cause horizontal overflow, breaking the responsive layout. Column layout blocks already prevent this using overflow-wrap: break-word and word-break: break-word, but row layout blocks lack this protection. This update aligns both layout types to handle long content gracefully.

How?

.is-layout-flex:not(.is-vertical) > * {
  overflow-wrap: break-word;
  word-break: break-word;
}

This CSS rule, targets direct children of row layout flex containers, ensuring that long words or unbroken strings wrap within their container boundaries and don’t overflow.

Testing Instructions

  1. Open a post or page in the block editor.

  2. Insert a Group block and set its layout to "Row".

  3. Add a Paragraph block inside the Group.

  4. Paste in a long unbroken string (e.g., a long URL or continuous text with no spaces).

  5. Resize the browser or preview on a narrow viewport.

  6. Observe whether the text wraps correctly without overflowing the container.

@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Debarghya-Banerjee <debarghyabanerjee@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Group Affects the Group Block (and row, stack and grid variants) labels Apr 21, 2025
@t-hamano
Copy link
Copy Markdown
Contributor

Thanks for the PR! Let's close this PR and investigate the ideal solution on #11956. See #50059 (comment) for more details.

@t-hamano t-hamano closed this May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Group Affects the Group Block (and row, stack and grid variants) [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group Block Content overflows when row layout is used

2 participants