-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Double ripple on touch devices with delegated click #78
Comments
Sorry, I think I forgot to mention you before that I have this problem earlier #44, and then I solved it by adding exclusion using if statement.
|
The problem is that some touch screen windows laptops will also have a mouse, so if we don't bind the mouse up event then mouse clicks won't initiate waves on those devices? We'll probably need a way of temporarily disabling waves for mouseup events if a touch event has occurred in the last 500ms or so. |
By disabling waves effect temporary for 175ms
It seems if the double ripple problem disappear if I disable event temporary. |
Fixed this issue by adding a TouchHandler which stacks clicks and disables mousedown for 500ms when a touchstart event occurs (doesn't affect the listeners so there's no performance loss with adding/removing listeners). On the train right now so I don't have Internet on the laptop, but I'll push the change later tonight :) |
(v0.6.0-dev) Fix issue #78: prevent double ripple on touch
Clicking a button or notification on Snarl while using an iOS device (or simulator?) will produce one ripple on the touch event, and then one ripple on the delayed mouseup/click event, meaning it double-ripples with a 300ms delay.
This doesn't happen with Waves v0.5.5, so I'll see why it's happening with the delegated click handler and how to stop it. (Disabling mouse or ripple events after the first touch for the following 500ms would probably fix it? But I'll see if there's a cleaner way.)
I reckon using fastclick.js would also solve it and make pages/buttons feel faster on mobile, but I'll investigate the Waves code first.
The text was updated successfully, but these errors were encountered: