Skip to content

Bug on Fixed Width setting on Row block's child blocks #58236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
daviedR opened this issue Jan 25, 2024 · 2 comments · May be fixed by #70324
Open

Bug on Fixed Width setting on Row block's child blocks #58236

daviedR opened this issue Jan 25, 2024 · 2 comments · May be fixed by #70324
Assignees
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Feature] Layout Layout block support, its UI controls, and style output. Needs Testing Needs further testing to be confirmed. [Status] In Progress Tracking issues with work in progress [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended

Comments

@daviedR
Copy link
Contributor

daviedR commented Jan 25, 2024

Description

When grouping 2 or more blocks into a Row block (horizontal flex layout), we can set the child blocks' width into 3 modes: Fit, Fill, and Fixed.

This issue occurred when the Row block has 2 child blocks:

  • 1st block is set to 300px Fixed width.
  • 2nd block is set to Fit or Fill, but the content inside this block is long so that it wraps into multiple lines.

This will cause the 1st block to shrink and not obey the 300px Fixed width setting. See the screenshot below:

image

This happens because the generated CSS for the 1st block with Fixed width setting is only flex-basis: 300px.
Additional CSS flex-shrink: 0 is required to ensure the 1st block doesn't shrink.

Step-by-step reproduction instructions

  1. Create a new page and paste the code snippet below in the block editor.
  2. Publish and save the page.

Screenshots, screen recording, code snippet

<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap","verticalAlignment":"top"}} -->
<div class="wp-block-group"><!-- wp:paragraph {"style":{"layout":{"selfStretch":"fixed","flexSize":"300px"}},"backgroundColor":"cyan-bluish-gray"} -->
<p class="has-cyan-bluish-gray-background-color has-background">This block is set to 300px Fixed width.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"style":{"layout":{"selfStretch":"fill","flexSize":null}},"backgroundColor":"cyan-bluish-gray"} -->
<p class="has-cyan-bluish-gray-background-color has-background">We have another block with very long content so that it wraps to the next line. And this will cause the first block to shrink and doesn't obey the 300px fixed width setting.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

Environment info

Installed WordPress version: 6.4.2
This issue occurred with and without the Gutenberg plugin installed.

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

@daviedR daviedR added the [Type] Bug An existing feature does not function as intended label Jan 25, 2024
@jordesign jordesign added [Block] Group Affects the Group Block (and row, stack and grid variants) Needs Testing Needs further testing to be confirmed. labels Jan 28, 2024
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Feb 28, 2024
@Adi-ty
Copy link

Adi-ty commented Jun 5, 2025

I was able to reproduce this issue on WordPress 6.8 using the Twenty Twenty-Five theme.

When placing a 300px Fixed-width block next to a long Fill/Fit block inside a Row layout (flex), the first block shrinks and doesn’t retain the intended width. Inspecting the layout shows the block rendering at less than 300px wide, confirming the missing flex-shrink: 0 is the cause.

Screenshots

Fixed-width block added inside a Row block
Image
Fill/Fit block added with long content
Image
Inspecting the fixed-width block
Image

This behavior is consistent with the issue described — the Fixed width setting alone applies only flex-basis, but not flex-shrink: 0, which is required to prevent the block from shrinking.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jun 5, 2025
@t-hamano t-hamano added the [Feature] Layout Layout block support, its UI controls, and style output. label Jun 6, 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) [Feature] Layout Layout block support, its UI controls, and style output. Needs Testing Needs further testing to be confirmed. [Status] In Progress Tracking issues with work in progress [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants