When a tooltip for an element is visible, and that element gets removed I would expect the tooltip to be hidden or removed.
A solution would be to bind a callback to the DOM-removal of the element. This could be done by using the "remove"-callback of "jQuery.event.special":
What do you think?
You can try that - but we don't want to do that in bootstraps core. My understand is the browser support is a bit spotty and it's easy enough to execute a close call before you blow your dom away. thanks for the input though!
Thanks for your answer!
I still think this is something bootstrap-tooltip should do, because:
For an implementation there seem to be two possible ways:
Here's an example with both methods:
Any chance to get this into bootstrap? Otherwise this might be a reference for someone else.
This is something most of not all tooltip plugins fail at. If you are using something partial Ajax updated for your UI toolstips get stuck on the screen. At my work we are using emberjs and all the tooltip plugins we have tried have this same bug.
The jQuery mouseleave event is not triggered when the element being hovered is removed from the dom.
same here with backbone.js, it happens often when sometimes we have to render again any dom with the tooltip already hover by its children. Bootstrap tooltip should really care about it as something core, because when you work with a lot of views those things just get worst if you have to call delete everytime something is removed.
This seems to be fixed in the current version (2.3.0), where the tooltip is appended immediately after the target-element, instead of added to the body.