kazzkiq / balloon.css

Simple tooltips made of pure CSS

Home Page:https://kazzkiq.github.io/balloon.css/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to remove tooltip after clicking on the button?

emaillenin opened this issue · comments

commented

The tooltip doesn't automatically disappear after the button is clicked:

tooltip-bug

Can be reproduced on https://kazzkiq.github.io/balloon.css/ too.

I could reproduce this only with Chrome 80.0.3987.149 on Mac OS 10.14.6.

Works fine with other browsers in the same OS.

This is because by default Balloon.css also triggers on :focus states. Sometimes after you click a button, it remais focused.

To prevent this behavior you can use the data-balloon-nofocus attribute. E.g.:

<!-- Will NOT appear on focus -->
<button aria-label="Hey!" data-balloon-pos="up" data-balloon-nofocus></button>

If you use nofocusthough, it won't appear when navigating with keyboard.