8000 iOS 8 tap issues · Issue #11 · GianlucaGuarini/Tocca.js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8000 /div>

iOS 8 tap issues #11

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

Closed
akrymski opened this issue Feb 4, 2015 · 8 comments
Closed

iOS 8 tap issues #11

akrymski opened this issue Feb 4, 2015 · 8 comments

Comments

@akrymski
Copy link
akrymski commented Feb 4, 2015

Thanks for an awesome library, I've been using something similar that I wrote myself for https://github.com/techlayer/espresso.js

Was wondering why the tap event isn't firing immediately after a touchEnd, but instead waits 200ms? Can't seem to wrap my head around that design decision, but you must have a reason.

On iOS 8 both a tap and a click event seem to get fired. Check this thread:
ftlabs/fastclick#262

This article sheds some light on the iOS 8 issues:
http://developer.telerik.com/featured/300-ms-click-delay-ios-8/

while the delay is still in place for “fast taps”, it has been removed for “slow taps”

@GianlucaGuarini
Copy link
Owner

The tap event is fired after 200ms because otherwise I cannot detect the dbltap events. In any case you can change this behavior by changing this option

@akrymski
Copy link
Author
akrymski commented Feb 4, 2015

That's what I figured. Unfortunately in Phonegap on IOS 8 if you hold for over 200ms no tap event is fired. Only quick taps seem to work.

On 4 Feb 2015, at 22:47, Gianluca Guarini notifications@github.com wrote:

The tap event is fired after 200ms because otherwise I cannot detect the dbltap events. In any case you can change this behavior by changing this option


Reply to this email directly or view it on GitHub.

@GianlucaGuarini
Copy link
Owner

And that's what a tap event it's supposed to be! If you hold your finger It's not a tap anymore so it works perfectly. If you want to change this behavior you can change the window.TAP_TRESHOLD I am going to close this that seems to be not a bug

@akrymski
Copy link
Author
akrymski commented Feb 5, 2015

can’t agree with that. apps listen to tap events instead of click events. so if my tap takes longer than 200ms i can’t detect it anymore? that’s clearly a bug to me. and TAP_THRESHOLD doesn’t fix that, as if you make it 300ms then the tap delay is as slow as the click delay. In fact 200ms isn’t even much faster than the 300ms delay you get with native click behaviour. That’s not how any of the other libs like FastClick work for example.

I’m pretty sure you can still detect double taps if you listen to touchend instead of touchstart. Two touchend events within a certain time threshold can be considered a double tap. That makes more sense to me than having a timeout listening to touchstart, unless I’m missing something.

On 4 Feb 2015, at 23:40, Gianluca Guarini notifications@github.com wrote:

And that's what's supposed to be a tap event! If you hold your finger It's not a tap anymore so it works perfectly. If you want to change this behavior you can change the window.TAP_TRESHOLD I am going to close this that seems to be not a bug


Reply to this email directly or view it on GitHub.

@GianlucaGuarini
Copy link
Owner

Ok It sounds a good idea, I will try the other way around using the touchend events to see if I can enhance it

@GianlucaGuarini GianlucaGuarini closed this as completed in 5541711 Feb 5, 2015 8000
@GianlucaGuarini
Copy link
Owner

Let me know if now it works better

@akrymski
Copy link
Author
akrymski commented Feb 9, 2015

Looks better, but still not sure if setTimeout is at all necessary. You could just fire a tap event on touchEnd. And if there's another tap within 200ms then also fire a double-tap.

I believe this is more inline with how iOS Gesture Recognizer works:

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITapGestureRecognizer_Class/index.html#//apple_ref/occ/cl/UITapGestureRecognizer

Although taps are discrete gestures, they are discrete for each state of the gesture recognizer; thus the associated action message is sent when the gesture begins and is sent for each intermediate state until (and including) the ending state of the gesture.

@GianlucaGuarini
Copy link
Owner

Ok it makes sense to trigger first a tap and eventually a dbltap. I will make a new release soon, thanks for your help

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

No branches or pull requests

2 participants
0