close
Skip to content

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

Open
sarthaknagoshe2002 wants to merge 2 commits intoWordPress:trunkfrom
sarthaknagoshe2002:fix/issue-76531
Open

Buttons: Enable Fit / Grow / Fixed width controls using layout support#76998
sarthaknagoshe2002 wants to merge 2 commits intoWordPress: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
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

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: 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
Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

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
Copy link
Copy Markdown
Member

ramonjd commented Apr 5, 2026

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've 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.

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

3 participants