calebjacob / tooltipster

A jQuery tooltip plugin
MIT License
2.76k stars 480 forks source link

Fails on reading `tagName` of `undefined`. #645

Closed danielgindi closed 7 years ago

danielgindi commented 7 years ago

Tooltipster fails on this line:

https://github.com/iamceege/tooltipster/blob/09bac138723db25eb00635f87104f1aab0038220/dist/js/tooltipster.core.js#L928

When using in a virtual scrolling container. Which means that it is rapidly initiated and destroyed on row elements as the user scrolls. It appears that if the mouse is over the row with the tooltips while scrolling with the mousewheel - the tooltip starts initiating, adds the element to the DOM for measuring, gets destroyed, and then reaching that line of code where it traversed to the parent but has no parent.

louisameline commented 7 years ago

Thank you, I'll take a look when I can.

fiftoine commented 7 years ago

I have the same error when integrating tooltipster in ember and run acceptance tests...

louisameline commented 7 years ago

I'm really booked these days, I'll be available in February for this. It will probably a quick fix though, I just need to take a break.

louisameline commented 7 years ago

Ok you got me ;) Try with the latest commits please. Thank you.

danielgindi commented 7 years ago

This seems to have fixed it! Thanks :-)

It does not automatically show the tooltip under the new element behind the mouse pointer, but at least it does not crash :-)

louisameline commented 7 years ago

The issue happened because, when the scroll happened, you had already removed the origin from the DOM (without destroying the tooltip first). That may help you understand what actually happens.