Closed apostololeg closed 10 years ago
Hi @truerenton, I had a look at your example. It seems to work correctly.
Would you be able to help me understand what you're expecting it to do and how that is different from what it actually does? Also could you tell me which browsers / devices you're having problems with?
I'm using an iPhone 4S with iOS 7.0.4.
Probably, you do a longpress, but when tap is short(it seems here) – backgorund don't goes white. Take a look this video https://dl.dropboxusercontent.com/u/7624831/Trash/2013-11-20_1548.swf and will become clear.
@matthew-andrews Could you have a look at @truerenton's example video?
@matthew-andrews I can confirm this issue and it exists in FastClick version 0.6.7 as well as version 0.6.11. Everything is working fine if you hold down a little, but whenever you just tap it doesn't. Present in at least Android 4.1.2, 4.2.2, 4.3 and 4.4 across various devices (Nexus 10, HTC Desire HD, HTC One X)
Hopefully the list of devices and versions helps
OK. I can reproduce the bug. You said in the original description that
'Without this
return
it seems everything is working well'
Which return
did you remove, was it this one?
https://github.com/ftlabs/fastclick/blob/master/lib/fastclick.js#L561
Right I think I know what the problem is. Normally in browsers when you tap in an input field the events are:
touchstart
touchmove
s)touchend
focus
click
(Note in the console logs I've used te
as shorthand to mean touchend
)
FastClick eliminates the 300ms delay in this case by manually triggering a focus
event when touchend
is detected however we don't trigger a click
event. So with FastClick the events look like this:
touchstart
touchmove
s)touchend
focus
Therefore I think the fix should just be to add a synthetic click after focus
ing on element so that FastClick events are consistent with the browser. I think this should be harmless - though I would like a second opinion from the other Matt. @mattcg what do you think?
Thanks for bringing this issue to our attention, @truerenton.
thankee, @matthew-andrews !
This should now be available in v0.6.12, sorry for the delay.
test page – http://skymorph.in/t/fastclick
I tried to understand problem, but only can I find that click event not firing due to the fact that
return
prevent all subsequent actions. Without thisreturn
it seems everything is working well.