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

Circular option picker: incorrect usage of Tooltip #68601

Open
2 of 6 tasks
afercia opened this issue Jan 10, 2025 · 0 comments · May be fixed by #68602
Open
2 of 6 tasks

Circular option picker: incorrect usage of Tooltip #68601

afercia opened this issue Jan 10, 2025 · 0 comments · May be fixed by #68602
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Jan 10, 2025

Description

Similar to #66271, #68591 and #68597 where a Tooltip component wraps a Button that uses an explicit aria-label attribute instead of the label prop.

This is unnecessary and introduces a risk where the visibel tooltip text mismatches the accessible name determined buy the aria-label attribute.

Additionally, the Ariakit-based Tooltip adds a dynamic aria-describedby attribute. As such, the accessible name and description repeat the color name unnecessarily. For example the button would have:

  • aria-label="Color: Accent"
  • aria-describedby: pointint to a tooltip with text Accent

This way, screen readers would announce the color name twice, the first time as part of the accessible name, the second time as the accessible description:

Image

Image

In this case, an additional accessibility problem is that the visible tooltip text mismatches the actual accessible name, This is a problem for sighted screen reader users and for voice control / speech recognition software users. For example, voice control users would see a tooltip with text Accent and may try to issue a voice command such as click Accent. That won't work because the actual accessible name is Color: Accent.

Worth reminding the tooltip should only be used to visually expose the actual accessible name of an interactive control.

Step-by-step reproduction instructions

  • Use a screen reader. Alternatively inspect the DOM.
  • Select a Paragraph block and click the text color setting in the settings pane;.
  • The color picker opens.
  • Navigate to one of the circular color buttons.
  • Observe when a color is focused a tooltip appears where the text is the color name.
  • Observe the screen reader announces the accessible name e.g. Color: Accent, and then the accessible description e.g. Accent.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Type] Bug An existing feature does not function as intended labels Jan 10, 2025
@afercia afercia self-assigned this Jan 10, 2025
@afercia afercia linked a pull request Jan 10, 2025 that will close this issue
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant