-
-
Notifications
You must be signed in to change notification settings - Fork 367
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tooltip accessibility: aria-labeledby
vs aria-describedby
#2228
Comments
Hi @brookewp! Thank you for bringing this up. After analyzing how sites were using tooltips, we've introduced Consider, for example, a button with an unlabelled (or In that case, if On the other hand, if we use But it's definitely a bug in our tooltip example. We should either use an icon button representing most use cases on existing web apps or use the |
Thank you for the detailed explanation!
All of these options would help to clarify but I am partial to the last suggestion; because of ARIA documentation, I would assume that |
So here's my idea:
|
It turns out that identifying if the element has an accessible name isn't a trivial task. We could use For now, users will have to explicitly define |
Current behavior
Hi there! 馃憢
Although the current behaviour is intentional, I've marked this as a potential bug; by default, the Tooltip component is not entirely accessible to screen readers.
Currently, Tooltip uses
aria-labeledby
instead ofaria-describedby
but has the option to change that withdescribed
:ariakit/packages/ariakit/src/tooltip/tooltip-anchor.ts
Lines 122 to 136 in 5d8a1f0
Steps to reproduce the bug
Screenshot of all that VoiceOver reads:
Expected behavior
From the guidelines in WAI-ARIA Tooltip Pattern, it states:
Since this isn't enabled by default, the anchor element is not announced, only the tooltip. Of course, with
described={ true }
we get the expected behaviour:A sandbox with a
described
example demonstrated in the gif above:https://codesandbox.io/embed/tooltip-with-described-8dzfew?fontsize=14&hidenavigation=1&theme=dark
The question:
Why is
aria-labelledby
the default instead ofaria-describedby
? Is there a scenario where a developer might want to usearia-labelledby
instead?Workaround
No response
Possible solutions
No response
The text was updated successfully, but these errors were encountered: