briancherne / jquery-hoverIntent

hoverIntent jQuery Plug-in
https://briancherne.github.io/jquery-hoverIntent/
MIT License
826 stars 253 forks source link

Don't become active if mouse left is down #70

Closed thomas-daniels closed 6 years ago

thomas-daniels commented 6 years ago

When you're hovering with your mouse down, it's usually in a drag/drop context when you probably don't want hoverIntent to become active - the specific use case where this change was required was a menu bar.

(note: I have no idea if this warrants a version change so I didn't touch that)

usmonster commented 6 years ago

Hi, and thanks for the PR!

While I agree with the rationale, I can also imagine similar cases where one would want hover (mouseenter/mouseleave) events to fire. Of course drag events are generally preferred, but normally one can add logic to avoid firing hover event listeners in those cases, even when using plain ol' jQuery .hover.

That said, I'm not really convinced this plugin should handle this case, especialli since it strives to be a drop-in replacement, and this change could potentially have undesirable side-effects. I'll close the PR for now, but please feel free to comment.

thomas-daniels commented 6 years ago

I see. This was just a change I had to make to a project using hoverIntent, and we thought about PR'ing it here for similar use cases. But I understand your point and wouldn't want to break things :)