Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if the element where the handler was attached is still present before triggering the 'show' (for tooltips with delay) #30

Open
rafaelchiti opened this issue Feb 23, 2014 · 0 comments

Comments

@rafaelchiti
Copy link

Maybe I'm doing something wrong, but imagine you have a list of elements and each item has its own sub item that allow the user to 'remove' that item from the list.
I attach a tooltip to each item with a delay, but the user can just get into the iteam with the mouse to click the 'remove' link, what happen is that tooltipsy will call the 'show' method when the timeout finishes the time delay and by then the 'item' does not exist anymore cause my logic removed it from the UI.

Would it be nice for the plugin in the first lines of the 'show' method to check if the item is still present in the DOM and from there execute the whole logic?. Again I had to do some crazy stuff with the UI but I guess is a common scenario when you set the tooltip to an element that can be removed, by the time the setTimeout reaches the 'show' method maybe the element does not exist anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant