ghosh / microtip

💬 Minimal, accessible, ultra lightweight css tooltip library. Just 1kb.
https://microtip.vercel.app/
MIT License
1.38k stars 74 forks source link

Tooltip on focus #12

Open GrigorM opened 6 years ago

GrigorM commented 6 years ago

The tooltip is shown on hover, but remains active on focus too. So when clicking a button with tooltip, the tooltip will remain active until i click somewhere else. I think the default behaviour should be to remove the tooltip after hovering out, and leave the current behaviour as optional, to be activated via a custom attribute.

shanehoban commented 2 years ago

This is an old issue but here is a kind of workaround that does the job for me:

[aria-label][role~="tooltip"]:not(:hover):focus::before,
[aria-label][role~="tooltip"]:not(:hover):focus::after {
  opacity: 0;
}