ftlabs / fastclick

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

Fastclick breaks Google Closure autocomplete widgets on mobile devices #117

Open stevebuik opened 11 years ago

stevebuik commented 11 years ago

If you use a closure autocomplete like the one here

http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/autocomplete-basic.html

and add Fastclick to the page then selection of matched items when typing does not work on touch devices. I've tested on iPad Chrome/Safari and Android Chrome and it breaks consistently on all of these.

What happens is that the autocomplete dropdown is dismissed but the value that was tapped does not get loaded into the input element.

It's a tough one to debug because it only reproduces on touch devices and I don't have a remote debugger for these browsers. Logging this bug in the hope that someone knows a simple workaround - my current workaround is to disable fastclick.

dryabov commented 11 years ago

goog.ui.ac listen to mousedown event, but fastclick doesn't trigger it.

In your case it's possible to override needsClick function to check for ac-renderer class in addition to needsclick.

PS. Are you sure that loading of 59 javascripts (1Mb in total) for just autocomplete is a good idea (especially on smartphones)?

stevebuik commented 11 years ago

Thanks for the fast reply. I'll take a look and see if I can work out a patch. I'm no js wizard so might take me a bit of time.

I'm actually using clojurescript to build my app and thus the google closure compiler does a good job of stripping out all the unused code for production use - the test case in the bug report is just a good place to show the problem.

bmatto commented 9 years ago

Seems like this affecting google places autocomplete as well.

craigstar commented 8 years ago

same issue here. Have you figured it out? @stevebuik

stevebuik commented 8 years ago

No I just avoided it and since then have stopped working on the project. Sorry but nothing new to report

Regards, Steve Buikhuizen

http://www.linkedin.com/in/stevebuikhuizen

Mob: +61 416426414

On 4 April 2016 at 23:59, craigstar notifications@github.com wrote:

same issue here. Have you figured it out? @stevebuik https://github.com/stevebuik

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/ftlabs/fastclick/issues/117#issuecomment-205306394

craigstar commented 8 years ago

I worked it out yesterday. not sure if this("needsclick" class) is the new feature. But this conversation really helps. https://github.com/ftlabs/fastclick/pull/347

On Mon, Apr 4, 2016 at 5:49 PM, Steve Buikhuizen notifications@github.com wrote:

No I just avoided it and since then have stopped working on the project. Sorry but nothing new to report

Regards, Steve Buikhuizen

http://www.linkedin.com/in/stevebuikhuizen

Mob: +61 416426414

On 4 April 2016 at 23:59, craigstar notifications@github.com wrote:

same issue here. Have you figured it out? @stevebuik https://github.com/stevebuik

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/ftlabs/fastclick/issues/117#issuecomment-205306394

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/ftlabs/fastclick/issues/117#issuecomment-205511833

guilhermeosmium commented 6 years ago

Find / \bneedsclick\b/ And Replace by /\bpac-item\b|\bneedsclick\b|\bpac-container\b/ Full Command( return/\bpac-item\b|\bneedsclick\b|\bpac-container\b/.test(t.className) )

In fast-click.js