Tooltip for Icon Button stays visible after button is clicked and mouse moves away
See original GitHub issueTooltip for Icon Button stays visible when button is clicked
-
carbon-components
-
carbon-components-react
Detailed description
When an Icon Button is clicked, the tooltip stays visible even when the mouse is moved away from the button. This happens since the button has focus, but it looks very odd to the user. I would expect for the tooltip to go away once the button is clicked.
What browser are you working in? Chrome / Firefox / IE / Edge
What version of the Carbon Design System are you using? carbon-components-react 7.17.0
What offering/product do you work on? Any pressing ship or release dates we should be aware of? Part of the Cognos Analytics offering with a release of end of October.
Steps to reproduce the issue
This behaviour can be seen in the Carbon sample for the Icon Button https://react.carbondesignsystem.com/?path=/story/button--icon-button
- Click on the button icon
- Move your mouse away from the button
BUG: The tooltip is still visible.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Bootstrap's tooltip doesn't disappear after button click ...
This is because trigger is not set. The default value for trigger is 'hover focus' , thus the tooltip stay visible after a...
Read more >About Tooltip Controls - Win32 apps | Microsoft Learn
The tooltip appears near the pointer and disappears when the user clicks a mouse button, moves the pointer away from the tool, or...
Read more >Tooltip – Carbon Design System
A tooltip is a message box that is displayed when a user hovers over or gives focus to a UI element. The tool...
Read more >ARIA: tooltip role - Accessibility - MDN Web Docs - Mozilla
The tooltip is displayed and disappears via keyboard focus and removal of focus and by the mouse events - mousing over and mousing...
Read more >JavaScript · Bootstrap
Don't use data attributes from multiple plugins on the same element. For example, a button cannot both have a tooltip and toggle a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One aspect that isn’t being discussed here and is what makes this truly feel like a bug is:
Position at least two buttons next to each other in such a way that if both of the tooltips are visible at the same time, they overlap with each other. With the current design, this is possible. Click on one button and then hover over the second button. You now have two visible tooltips that overlap.
How do we prevent this situation from happening?
Please don’t just add a timeout - it’s a bit more complicated than that. The “persistence” thing is a WCAG 2.1 requirement, which is relatively new (IBM began requiring WCAG 2.1 about a year ago), so it’s not well understood yet.
I believe there is some “interpretation wiggle room”, though, that would make for better UX and still meet the WCAG requirement.
What you can do is:
Here’s the example code for Sarah’s excellent article Tooltips in the time of WCAG 2.1.