-
Notifications
You must be signed in to change notification settings - Fork 448
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
Accessibility issue due to aria-label #146
Comments
@kazzkiq should we have both Ideally, the tooltip should close on pressing the escape key as well so is there any way I can achieve that by adding an attribute to the tooltips if i add an event listener? |
Why should we close the tooltip on escape? For hover and focus, should we have an escape handler? Is the escape control mentioned on the accessibility spec?
Even if you use
There are in general two use cases for tooltips.
|
As per the guidelines When additional content is triggered on pointer hover or on keyboard focus, that additional content MUST be visually perceived and MUST be dismissible hence If the content obscures or replaces other content, it should be dismissed via keyboard without moving mouse hover or keyboard focus - such as by pressing the Escape key.
Yep, that's what I tried mentioning above and hence sadly CSS tooltips will have some limitations when it comes to Accessibility.
Yep, I was talking about the 2nd case. I have tried incorporating the button text to the tooltip and it won't be a good user experience if we incorporate all the data to |
I believe using This also appears to be more in-line with what WAI-ARIA recommends. Their guidance assumes that the tooltip is in a separate element and recommends using I'm going to play around with this a bit more, and open a PR if it works. I'll also need to ensure backwards compatibility with |
Hmmm actually,
Looking at caniuse.com, browser support only seems to be for Chrome and Edge at the moment. For what it is worth, I do have a draft pull request for However, I would be nervous moving to a not-yet-supported feature of two major browsers, so I'll leave it to the maintainers' judgement as to whether this is a wise move, and I'll move the linked PR to 'open' if so. |
Adding aria-label does announce it to screen readers but the container element on which the tooltip is shown, the text of that button for example won't be announced as shown in https://kazzkiq.github.io/balloon.css/ the text Hover me is not announced since the aria-label now just has the tooltip text which is an accessibility issue.
ideally, first, the button content should be announced and then the tooltip content.
For the accessibility, role tooltip should be added to the tooltip so screen readers announce it as tooltip but since it uses pseudo-element so won't be possible.
The text was updated successfully, but these errors were encountered: