Closed juanfra closed 2 days ago
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: juanfra <juanfra@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: afercia <afercia@git.wordpress.org>
Co-authored-by: Mayank-Tripathi32 <mayanktripathi32@git.wordpress.org>
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.
Flaky tests detected in 50d781e8aae86ade99e7c9b0b80c3ce7daf661ee. Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11915640893 📝 Reported issues:
/test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js
It's worth reminding why in most cases there is the need to use accessibleWhenDisabled
when disabling a button.
Under the hood, it uses aria-disabled
instead of the HTML attribute disabled
.
When using the keyboard, disabling a button on the fly with disabled
would make the button no longer focusable while focus is on it. As such, there would ba a focus loss. After tabbing again, the tab sequence would start from scratch from the document root (although browsers try to remediate in some way).
To avoid focus losses and to make controls discoverable also when disabled, Gutenberg uses the aria-disabled
pattern + some styling.
Thank you both!
And thanks, @afercia, for the detailed explanation—I’ll definitely keep that in mind moving forward. 🙌
Merging this one now! 🚀
What?
Fixes https://github.com/WordPress/gutenberg/issues/67107
Disable the "Clear" button if there's no color value for the color palette component.
EDIT: I also applied the same logic to the
GradientPicker
andDuotonePicker
here.Why?
The “Clear” button in the ColorPalette is currently active even when no color value is set. This can be confusing for users, as clicking the button doesn’t do anything in this case. It would be more intuitive if the button were disabled when there’s no color to clear.
How?
By setting it disabled. if there's no value.
Testing Instructions
Color picker & gradient picker
Duotone
Screenshots or screencast
https://github.com/user-attachments/assets/235ff9ac-b561-4e60-ad8d-ddc25dedac52