qTip2 / qTip2

qTip2 - Pretty powerful tooltips
MIT License
2k stars 469 forks source link

Using 'unfocus' for hide event breaks hoverintent behavior #86

Closed kiddailey closed 13 years ago

kiddailey commented 13 years ago

If you specify 'unfocus' for the hide event, the hoverintent behavior of show.delay is broken and the tooltip displays even if the user has hovered out of the trigger before the time has passed:

http://jsfiddle.net/kiddailey/LjKhW/

// Create the tooltips only when document ready
$(document).ready(function()
{    
    $('.selector').qtip({
        show: {
            delay: 1000
        },
        hide: {
            event: 'unfocus'
        }
    }); 
});
Craga89 commented 13 years ago

Fixed in the latest commit, thanks kiddailey!

kiddailey commented 13 years ago

Dd some testing with this on my jsFiddle above and my dev site and it seems that it is fixed for the first display of the tooltip. However, once the tip has been rendered, the hover intent behavior is again broken.

Would you like me to create a new issue for this since this one is closed (I can't seem to reopen it)?

Craga89 commented 13 years ago

The problem here is that hoverIntent works by using your hide events... rather than the opposite of the events you use in your show.event. Perhaps it would be more logical to use the opposite events e.g. mouseenter/leave hmmm...

kiddailey commented 13 years ago

Bumping this again since I'm still seeing the issue and I had almost forgotten about this :)

Craga89 commented 13 years ago

Ok hopefully the last commit fixed it. Changed the fix to make sure mouseleave is used for hoverIntent if it isn't present and mouseenter/over is used for show.event.

kiddailey commented 13 years ago

Definitely seems to have done the trick. Tested with a variety of hover-intent tooltips and all appears good. Thanks!