Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow timed delay which is cancelled by the mouse re-entering. Fixes #48. #55

Merged
merged 1 commit into from
Aug 17, 2014
Merged

Conversation

colinodell
Copy link
Contributor

This feature allows developers to provide a "grace period" where the mouse may leave the body for a short time without immediately triggering the modal - it will only appear if the mouse does not re-enter after delay ms.

This new feature also fixes issue #48. When you mouse into the page from the toolbar, Windows Chrome 35+ seems to trigger these events in quick succession:

mouseenter
mouseleave
mouseenter

That middle mouseleave would normally cause the modal to appear; however, due to the new feature, the subsequent mouseenter will cancel that timer and thus the modal won't appear. (This even works if delay is set to 0)

This fixes issue #48 for me on Windows 7 64-bit Chrome 36.0.1985.103 beta-m.

@colinodell
Copy link
Contributor Author

I should mention that I wasn't able to build the project due to local configuration issues. I hope you wouldn't mind building it for me, should this be approved.

@colinodell
Copy link
Contributor Author

@carlsednaoui, what are your thoughts on this feature?

@jescalan
Copy link
Contributor

Is there any use case for this other than a temporary workaround for #48?

@colinodell
Copy link
Contributor Author

One possible use case is making the modal feel less intrusive than an instant popup. A small delay (150-400ms perhaps) still makes the message seem important but not so urgent/in-your-face.

It also allows you to "fuzz" the actual trigger, making it feel less like a mouseleave event, and more like the site actually knows you're not interested.

Regarding #48, the only other solution I can think of is monitoring mouse movements, which is certainly doable (but slightly more complex to implement).

@soundswaste
Copy link

I am facing the exact same problem in chrome (36.0.1985.125 m)
You guys were able to find any fix?

@jhard
Copy link

jhard commented Aug 17, 2014

This fixes the issue for me.
I was able to reproduce the issue on Chromium 34.0.1847.116 on Lubuntu and multiple Chrome-Versions on Windows 7. Small timeout values (0-30ms) didn't seem to work, 150ms works just fine and doesn't mess with the functionality imho.

Maybe this could get a default value if browser == chrome?

@carlsednaoui carlsednaoui merged commit cb5d438 into carlsednaoui:master Aug 17, 2014
@colinodell colinodell deleted the event-delay branch August 19, 2014 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants