ngryman / jquery.finger

:v: jQuery touch & gestures, fingers in the nose.
https://ngryman.sh/jquery.finger/
MIT License
423 stars 66 forks source link

Tap event fires together with doubletap event #22

Closed yairEO closed 10 years ago

yairEO commented 10 years ago

This should never ever happen. only one event at a time. most people put 2 different events on an object, and the UX will get crazy when the user double tap to do one action and the single-tap event also gets fired and does the second thing, which wasn't intended to happen at all.

ngryman commented 10 years ago

Theoretically, I totally agree with you.

But this would involve adding a delay to the tap event in order to check if a second one is fired (this is why there is a default 300ms delay in touch enabled browsers). It would defeat the main purpose of Finger: kill this 300ms delay.

If you do want tap and doubletap on the same element, then just use the standard click event instead of tap :)

yairEO commented 10 years ago

I've written a jQuery special event for this purpose: https://github.com/yairEO/touchy

tlhunter commented 9 years ago

What would be awesome is if Finger knows that BOTH tap and doubletap are being listened for on an element, it retains the 300ms delay, but when ONLY tap is being used, skip the 300ms delay.

ngryman commented 9 years ago

@tlhunter This is an edge case involving too much code, without mentioning that some users may want another behaviour. It's out of Finger's scope. In this kind of scenario, I would advice to handle this yourself as you have all you need to do so.