Skip to content

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

@rafaelchiti

Description

@rafaelchiti

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions