ftlabs / fastclick

Polyfill to remove click delays on browsers with touch UIs
MIT License
18.66k stars 3.22k forks source link

focus triggered on incorrect field after scroll. #36

Open tokafish opened 11 years ago

tokafish commented 11 years ago

Hi everyone,

We're using fastclick in an iOS web application, and are encountering an issue with focus and fastclick.

See the fiddle here:

http://jsfiddle.net/xJrsW/

open this URL in iOS: http://jsfiddle.net/xJrsW/embedded/result/

The problem occurs when the iPhone scrolls as a part of focusing the field.

1) I scroll the to the very top of the document: 2) I tap (and hold) on textfield 3, then release 3) textfield 5 focuses

the problem is intermittent, and a simple quick tap on #3 does not cause the problem.

Any ideas on what might be going on?

Thanks!

mattcg commented 11 years ago

Thanks for reporting and for the excellent example. I'm able to reproduce this on iOS5 in the simulator.

mattcg commented 11 years ago

Implemented a workaround, even if I'm not very happy with it. @wless1 will you verify that this fixes the issue please?

tokafish commented 11 years ago

Awesome, works perfectly. Didn't realize the problem was that it was focusing something that would already be getting focus due to a delayed click.

Much improved user experience!

On Thu, Nov 29, 2012 at 4:46 PM, Matthew Caruana Galizia < notifications@github.com> wrote:

Implemented a workaround, even if I'm not very happy with it. @wless1https://github.com/wless1will you verify that this fixes the issue please?

— Reply to this email directly or view it on GitHubhttps://github.com/ftlabs/fastclick/issues/36#issuecomment-10873634.

mattcg commented 11 years ago

Thanks :)

The workaround is a bit hacky - hopefully there's a more long term solution that will fix both this issue and issue #32.

jeybe commented 11 years ago

@mattcg this did not at all solve it for me, it merely made things worse. Now the focus is jumping around among the input fields.. Alas, this issue has not been solved and should not be closed.

mattcg commented 11 years ago

@jeybe has the behaviour improved with the last commit?

ProcuraIsaac commented 11 years ago

This is similar to #42.

mattcg commented 11 years ago

Is anyone able to replicate this issue? Because I can't.

vhmth commented 11 years ago

I can't repro on iOS6 simulator (from the jsfiddle at the top).

Pointy commented 11 years ago

If you're still tweaking this, I'm noticing that on Android 4.x devices (an HTC One X with 4.0.3 and a Nexus 7) in Chrome that the 100ms "fudge factor" is a little long in the case of taps on elements goes way up. At 100, I get the select popup only very rarely (maybe one try out of 20).

Oddly enough, when the value was set at 100, I noticed that though it was really hard to get a