-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
BoxControl: Fix aria-valuetext
value
#68362
Conversation
Flaky tests detected in 8c0bc3d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12545086036
|
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* BoxControl: Fix `aria-valuetext` value * Update changelog Co-authored-by: t-hamano <[email protected]> Co-authored-by: tyxla <[email protected]>
Related to #67688
What?
This PR applies the appropriate label to
aria-valuetext
when theBoxControl
component has presets, allowing screen readers to properly announce the preset values.Why?
The
aria-valuenow
attribute is used in a range widget to communicate the current value, and thearia-valuetext
attribute is used to provide more human-readable text.The current implementation references the
label
field, which is always an empty string, soaria-valuetext
is effectively non-functional.How?
From my understanding, the reason the
label
field is empty is because we do not want to display a visual mark label, so thelabel
field should be left empty. Instead, apply the tooltip text toaria-valuetext
as well, so that the text read by screen readers matches the visual tooltip text.This should match the implementation of the
SpacingSizesControl
component.Testing Instructions
npm run storybook:dev
aria-valuetext
attribute via your browser developer tools.Screenshots or screencast
3ade381fd967ce06444a3114e4b32a39.mp4