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

Tooltip content is visibly hidden but still in accessibility tree so it is read by VoiceOver #60

Open
davidhousedev opened this issue Jan 29, 2021 · 0 comments

Comments

@davidhousedev
Copy link

davidhousedev commented Jan 29, 2021

Currently, this library only uses opacity to visibly hide the tooltip. It then makes its content available to screen readers by overriding the accessible name of the associated node. This leads to a situation where the content is visibly hidden but still present in the accessibility tree.

Various screen readers disagree about what to do with content that has opacity set to 0. Some screen readers will ignore this content, but VoiceOver reads it out. This means that VoiceOver effectively reads out the content of aria-label twice, once when the cursor is on the tooltip node itself, and again when the cursor is set to the ::after pseudo-element.

To replicate:

  • Implement the tooltip in the DOM
  • Open OSX VoiceOver
  • Use VO-right to traverse the page
  • Notice that VO will read out the tooltip node and will also stop on the ::after element, reading out the content again

In my own work, I got around this by setting display: none on the ::after element, then unsetting it on focus or hover. This breaks the animations in the tooltip, but provides, in my estimation, a better experience on a screen reader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant