wintercounter / Protip

A new generation jQuery Tooltip plugin
http://protip.rocks
MIT License
359 stars 38 forks source link

protip not hide in random cases owner element hides itself #42

Open lbrevity opened 5 years ago

lbrevity commented 5 years ago

Hello, I have following in my code

<div class="con exists" id="Section1">
    <input id="course_slide" maxlength="250" type="text" name="slide1" />
    <a class="ic-btn add protip" data-pt-position="top"  data-pt-scheme="aqua"  data-pt-title="Add"  id="addLabel_slide" onclick="add();">
        <span class="glyphicon glyphicon-ok"></span>
    </a>
</div>

It displays proper on hover of element, But after one ajax call inside add() function , I remove this div using jquery but it still displays tooltip. Note : If i click f12 then it hides.

wintercounter commented 5 years ago

Can you show me the callback of the Ajax call please. You can also try data-pt-target="true" which will place the tooltip inside you DOM element thus removing both. But yes, by default it should get removed.

lbrevity commented 5 years ago

Hi @wintercounter I'm just doing $('#Section1').remove(); inside my ajax call response

lbrevity commented 5 years ago

And Yes @wintercounter , As per your suggestion I tried data-pt-target="true", but it's not showing even.

wintercounter commented 5 years ago

I could reproduce the issue. https://jsfiddle.net/9kt3hfpj/1/ It probably has been introduced with a recent change as wiyh older versions it's working. You can you $('#Section1').protipHideInside().remove() as a workaround until it's fixed.

lbrevity commented 5 years ago

@wintercounter Oh thanks!! it works as of now!! Saved my day :+1: