I have a few tooltips in some text that are interactive. They have delays on closing to make them less likely to accidentally close when you try to interact with them.
The problem is when you skip to another tooltip, the previous tooltip remains open due to the delay. If I skip over a few quickly, it creates a big mess of overlapping tooltips. It would be nice if Tippy could close all the other tooltips when I open a new tooltip.
This is kinda related to #81, but for closing delay instead of opening delay.
For now you can implement custom logic
tippy(ref, {
onShow(instance) {
document.querySelectorAll('.tippy-popper').forEach(popper => {
if (popper !== instance.popper) {
popper._tippy.hide()
}
})
}
})
@atomiks Nice, thanks!
v4's .hideAll() method makes this simpler:
tippy(ref, {
onShow(instance) {
tippy.hideAll({ exclude: instance })
}
})
Most helpful comment
v4's
.hideAll()method makes this simpler: