Skip to content
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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Dec 28, 2024

Related to #67688

What?

This PR applies the appropriate label to aria-valuetext when the BoxControl 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 the aria-valuetext attribute is used to provide more human-readable text.

The current implementation references the label field, which is always an empty string, so aria-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 the label field should be left empty. Instead, apply the tooltip text to aria-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

Screenshots or screencast

3ade381fd967ce06444a3114e4b32a39.mp4

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components Needs Accessibility Feedback Need input from accessibility labels Dec 28, 2024
@t-hamano t-hamano self-assigned this Dec 28, 2024
@t-hamano t-hamano requested review from youknowriad and a team December 28, 2024 03:17
Copy link

Flaky tests detected in 32fd9f7.
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/12523287470
📝 Reported issues:

@t-hamano t-hamano marked this pull request as ready for review December 28, 2024 07:03
@t-hamano t-hamano requested a review from ajitbohra as a code owner December 28, 2024 07:03
Copy link

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: t-hamano <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Accessibility Feedback Need input from accessibility [Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant