Destroy/hide event breaks if event is initialized from inside the qtip. #476

Closed
coppermind opened this Issue Feb 21, 2013 · 5 comments

Projects

None yet

4 participants

@coppermind

qTip2 normal behavior is usually that when the selector is removed from the page the qtip popup hides itself. We are trying to use it wherein the element that initializes the reset/hide action for the selector is inside the qtip itself. This breaks the close method and the qtip fails to hide itself.

We are currently employing a workaround by inserting a 'hide' call when the selector is refreshed. eg. $(selector, context).qtip('hide');

@Craga89

Can you please setup a reproducible test case? http://jsfiddle.net/fdavn

@farlop

Hi! Don't know if exactly related to this problem, but sure it has something to do with destroying qTips. I'm using this solution (http://stackoverflow.com/a/13929294/1152186) to get qTip in my error messages on an ASP.NET MVC4 project. This worked flawlesly in version v2.0.1-4-g, but recently I upgraded it to v2.0.1-26- and now it fails on destroying tooltips.

I've done some researching and noticed some clues to point to the recent modifications to the 'destroy' function:

1st: Line 1345
self.destroyed = !(self.rendered = FALSE);

After that, when inner 'process' function runs, the if(self.rendered) code in line 1353 is always false, and the tooltip is not fully destroyed.

2nd: Line 1344
if(self.destroyed) { return; }

In IE is false, but in Chrome is true, so the destroy never is procesed in that browser.

3rd: In my code, I had to force the immediate param to get the process function executed.
else { elem.qtip('destroy', true); }

If not, process function never gets invoked through hide().

I hope this information helps to find a solution. Meanwhile, returning to v2.0.1-20-, which works just fine

@Craga89 Craga89 closed this in bb0c2f4 Feb 26, 2013
@Craga89

Thanks for looking into that farlop, much appreciated! Check out the latest commit for a fix on this

@farlop

Hi! It works fine again! Thank you for so quick response!

@smorsi

Guys, this bug still occurs in qtip2 v2.2.0!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment