-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add Button support for iconPosition top and showDescription #62412
base: trunk
Are you sure you want to change the base?
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +106 B (+0.01%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Note: while working on this PR I noticed a with icon buttons and the buttons flex layout. By default the SVG icons are flex items and they can shrink. Normally, this isn't a problem. But, when a button shows both the icon and the text and the button width is constrained in some way, the icon shrinks and gets smaller. The width constrained may come, for example, from a container element or from some width set to a custom button. I don't think icons should ever shrink so I added |
63b3a06
to
9d200ae
Compare
Flaky tests detected in 7292658. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9580890599
|
7292658
to
a65690f
Compare
a65690f
to
f5c569f
Compare
I second @mirka 's feedback shared here. it seems that looking for a more generic and modular solution like in #62373 (comment) could be a better way forward. More in general, I don't think I'll let Lena answer directly next week, though. |
Fixes #62373
What?
iconPosition
prop to support a newtop
value.showDescription
prop to make the Button accessible description visible.Why?
As detailed in #62373 there are scenarios where a Button would benefit from a couple new features:
Both features would allow to avoid 'ad-hoc' implementations and overrides in the editor components, which also add maintenance cost, inconsistencies, and are prone to bugs and reduced accessibility.
How?
See above
Testing Instructions
npm run storybook:dev
.iconPosition
prop to 'top.describedBy
prop.showDescription
prop totrue
.Testing Instructions for Keyboard
Screenshots or screencast