Skip to content

Separator Block: prevent block from collapsing to zero size inside row/stack layouts#80308

Open
dhruvikpatel18 wants to merge 1 commit into
WordPress:trunkfrom
dhruvikpatel18:fix/separator-in-row-stack
Open

Separator Block: prevent block from collapsing to zero size inside row/stack layouts#80308
dhruvikpatel18 wants to merge 1 commit into
WordPress:trunkfrom
dhruvikpatel18:fix/separator-in-row-stack

Conversation

@dhruvikpatel18

@dhruvikpatel18 dhruvikpatel18 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #47993
Fixes the Separator block disappearing (rendering at zero size) when placed inside a row or stack Group block variation, in both the editor and the front end.

Why?

The wp:separator block renders as an empty <hr> with no content. row/stack group variations use display: flex, and a flex item with no content has no natural size on the main axis unless one is explicitly set. As a result:

  • Inside a stack (vertical main axis), the separator's height collapses to 0.
  • Inside a row with flexWrap: nowrap (horizontal main axis), the separator's width collapses to 0.

This affects the default and wide separator styles. The dotted style (is-style-dots) was unaffected because it derives its width from generated pseudo-element content rather than layout, so it never collapsed. This same root cause was also reported affecting the Query Pagination block (#44587), which uses the same flex-based group layout internally.

Testing Instructions

  1. Insert a Group block and switch its variation to Row.
  2. Insert a Separator block inside it (default style), followed by a paragraph.
  3. Confirm the separator is visible in the editor and on the front end.
  4. Repeat steps 1–3 with the Stack variation.
  5. Repeat with the Wide separator style, in both Row and Stack.
  6. Repeat with the Dots separator style, in both Row and Stack, confirm the dots render normally and are not stretched full-width.

Screenshots or screencast

Screen.Recording.2026-07-15.at.4.08.49.PM.mov

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jul 15, 2026
@dhruvikpatel18
dhruvikpatel18 marked this pull request as ready for review July 15, 2026 11:19
@github-actions

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Block library.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @jasperf, @Invoke-STPE.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: jasperf, Invoke-STPE.

Co-authored-by: dhruvikpatel18 <dhruvik18@git.wordpress.org>
Co-authored-by: skorasaurus <skorasaurus@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Separator is not visible when inside row or stack

1 participant