ftlabs / fastclick

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

fastclick breaks bootstrap dropdowns for iOS devices #48

Closed mgcrea closed 11 years ago

mgcrea commented 11 years ago

Tested on latest iOS6.

The dropdown closes itself.

Test case : http://mgcrea.github.com/angular-strap/#dropdown

mattcg commented 11 years ago

Thanks for reporting.

mattcg commented 11 years ago

It seems that Bootstrap makes FastClick redundant by using touchstart listeners with dropdowns. Is there a reason why you need FastClick even when you're using Bootstrap?

nanek commented 11 years ago

Bootstrap doesn't add touchstart to everything. It's not on buttons for instance. Seems like fastclick is the recommended solution for that, https://github.com/twitter/bootstrap/issues/3772#issuecomment-11563061

So you still need FastClick when using Bootstrap.

mattcg commented 11 years ago

@nanek thanks for pointing that out. Are you more in favour of a workaround being added to FastClick, or attempting to have Bootstrap devs remove the touchstart listener for dropdowns?

Anyone else?

mattcg commented 11 years ago

@nanek Thanks for submitting that pull request to Bootstrap.

Everyone else: we're trying to get this fixed in Bootstrap itself.

ghost commented 11 years ago

Even though I concur that removing touchstart is the way to go, is there a way to unregister fastclick on a certain element? The way fastclick is now, it's either everything or nothing, right?

mattcg commented 11 years ago

There is a way. Add the needsclick class to an element.

On Tuesday, 15 January 2013, VenQWish wrote:

Even though I concur that removing touchstart is the way to go, is there a way to unregister fastclick on a certain element? The way fastclick is now, it's either everything or nothing, right?

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

ghost commented 11 years ago

Ah crud, missed that in the advanced section, sorry for that. Thanks for the blistering fast answer. :+1:

arush commented 11 years ago

Thanks for this @mattcg ran in to the same problem today. I would suggest you add the "needsclick" tip to the github documentation, as this article: http://labs.ft.com/articles/ft-fastclick/ says you should actually use 'clickevent'

UPDATE: submitted pull request 59

mattcg commented 11 years ago

Fixed in twitter/bootstrap commit 566380b.