atomiks / tippyjs

Tooltip, popover, dropdown, and menu library
https://atomiks.github.io/tippyjs/
MIT License
11.92k stars 520 forks source link

Tooltip persists even after the element is hidden #938

Closed amanagr closed 3 years ago

amanagr commented 3 years ago

Bug description

When tooltip is displayed and the element on which the tooltip was shown is hidden, tooltip persists.

Reproduction

CodePen link: https://codepen.io/amanagr/pen/xxgPJye

(Just hover over the button, the button will hide itself after 5s)

amanagr commented 3 years ago

Someone else also requested this in #419.

atomiks commented 3 years ago

This sort of thing is your responsibility to handle rather than the library's.

amanagr commented 3 years ago

Can you add an option in hideAll which someone can call periodically like a cron job which destroys tooltips whose reference elements are no longer present in DOM or displayed?

amanagr commented 3 years ago

or any way I can access all the mountedInstances directly.

amanagr commented 3 years ago

Oh! https://github.com/atomiks/tippyjs/issues/745#issuecomment-607531942 answers that for me. Thanks for your help.

amanagr commented 3 years ago

I do think this discussion should be documented on the plugin page.