-
Notifications
You must be signed in to change notification settings - Fork 794
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] WCAG 2.1 AA Hover Content Disappearing #620
Comments
Thanks for bringing this to our attention. I am curious to understand if this applies to I can understand the requirement for other forms of components popping up on hover. For example, we have recently added a Are you able to share more information about this? |
Quoted from the 1.4.13 success criterion:
|
Yeah I saw this, I'm just curious about what the difference is between title attribute and custom tooltips. ie. if they behave the same way exactly, why is one exempt and the other isn't? |
That is a good point. I can reach out to some subject matter experts to see if I can get more clarity around this part of the spec. |
I talked with Glenda Sims, one of the authors of WCAG. According to her, the reason the title attribute doesn't fall under 1.4.13 is because it is the Browser Vendor's responsibility to fix the accessibility issue regarding the user agent title tooltip. This protects developers from being at fault for an accessibility issue that is the fault of the Browser Vendor. Regardless of that, if you do make a custom tooltip, it does need to be hoverable by the cursor as stated in the second note under the Success Criteria. More information on why this needs to be met can be found on the understanding page: https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus.html |
Thanks both for the extra info 🙏, that's very helpful. |
For additional context, the Material UI Tooltip's Ran into a use case for it today when I was presenting a tooltip implementation and realised there's no way to point to a particular section of the tooltip with the mouse. |
Hey, so we kinda need this for an implementation we're working on. I am assuming a toggle/feature for this doesn't exist yet but is there something I can do in the meantime to keep the tooltips visible when hovering over them? |
@FarazPatankar For now, you can render the <Tooltip.Root>
<Tooltip.Trigger>
Hover me
<Tooltip.Content>
Tooltip content
</Tooltip.Content>
</Tooltip.Trigger>
</Tooltip.Root> https://codesandbox.io/s/crimson-cherry-phvi2 You can also control the component if you need more control, for example, to prevent the tooltip content from closing when you mouse down on it (for text selection) https://codesandbox.io/s/clever-waterfall-0sgpc |
Hey, @jjenzz, your comment works as expected. There's a minor issue with this approach: I am not sure if it applies to a WCAG 2.1 standard. If you have a link in the content of the tooltip, the link won't work. Can tooltips have actionable elements inside? |
No, tooltips should not contain any interactive content. |
For the sake of information, I took some time to look for references confirming your assertion:
I hope it may help. Thanks for your work so far 🙏 |
Would love to have this implemented, as of now we cant use this because of strict accessibility requirements. Specifically this rule
|
I have been using the technique that @jjenzz suggested in this thread. However I encountered an issue using that technique when I pass the trigger element as a child to the I have modified @jjenzz's codesandbox to demo the issue: https://codesandbox.io/s/frosty-pine-pj2o1u?from-embed=&file=/src/ToolTip.jsx The issue occurs when using the |
Bug report
Current Behavior
Tooltip content disappears when a user tries to hover over it. This violates WCAG 2.1 AA Success Criterion 1.4.13 Content on Hover or Focus.
Expected behavior
Tooltip content should remain present when a user moves their cursor to the tooltip and when the cursor is hovering over the tooltip content. This should follow the WCAG 1.4.13 success criterion https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus.
Suggested solution
Two options that I know of:
mouseOut
event.Your environment
The text was updated successfully, but these errors were encountered: