Skip to content

Buttons: Enable Fit / Grow / Fixed width controls using layout support#76998

Closed
sarthaknagoshe2002 wants to merge 2 commits into
WordPress:trunkfrom
sarthaknagoshe2002:fix/issue-76531
Closed

Buttons: Enable Fit / Grow / Fixed width controls using layout support#76998
sarthaknagoshe2002 wants to merge 2 commits into
WordPress:trunkfrom
sarthaknagoshe2002:fix/issue-76531

Conversation

@sarthaknagoshe2002

Copy link
Copy Markdown
Contributor

What?

Closes #76531

Why?

Currently, Button blocks inside a Buttons block do not expose the same sizing controls (Fit / Grow / Fixed) that are available when placed inside a Row block.

As a result users cannot proportionally size multiple buttons.

How?

The PR sets "allowSizingOnChildren" to true & removes existing width control.

Testing Instructions

  1. Open a post or page in the editor
  2. Insert a Buttons block
  3. Add two or more Button blocks inside it
  4. Select one of the Button blocks
  5. Open the Settings sidebar

Screenshots or screencast

Before After
image image

@github-actions

github-actions Bot commented Apr 2, 2026

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: sarthaknagoshe2002 <sarthaknagoshe2002@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: henriqueiamarino <iamarinoh@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] Enhancement A suggestion for improvement. [Block] Buttons Affects the Buttons Block and removed [Package] Block library /packages/block-library labels Apr 2, 2026

@t-hamano t-hamano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

If my understanding is correct, I don't think we can simply replace width support with layout support because it would break backward compatibility. It might be possible to migrate to layout support, but that would likely require a fairly complex migration process.

cc @aaronrobertshaw @ramonjd @andrewserong

@ramonjd

ramonjd commented Apr 5, 2026

Copy link
Copy Markdown
Member

I think @t-hamano is right: removing a block support would cause regressions.

Here's what happens with existing block markup containing button widths:

Screenshot 2026-04-05 at 12 47 43 pm

Also the control isn't set up to support theme presets, which was one of the defining motivations behind #74242 if I'm not mistaken:

Screenshot 2026-04-05 at 12 49 07 pm

Not saying that harmonizing layout and width is impossible, but it requires a little more groundwork.

@aaronrobertshaw

Copy link
Copy Markdown
Contributor

I've recently been toying with the idea of extending block supports to allow support for conditionally determining the CSS property the support targets. A left field idea here might be to allow the Button block's width support to target flex-basis etc instead of width only.

This is simply a random thought bubble and hasn't been thought through at all, so I only mention it as food for thought.

More importantly, I agree with Ramon and Aki here; additional planning is needed to ensure width support and layout play nicely together. Width support was a simpler adoption than layout support but even that was difficult to do in a backward-compatible manner.

@t-hamano

t-hamano commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Thank you for your feedback! Let's close this PR for now and focus on planning first.

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

Labels

[Block] Buttons Affects the Buttons Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Button block: Mirror Row layout with Fit, Grow, and Fixed width controls per Button

4 participants