-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Ghost clicks' on iOS when elements are created dynamically #10
Comments
Is this ever going to get fixed? |
I got this fixed by adding e.preventDefault(); in the touchstart function var touchstart = function(e) { |
@thomasvankerckvoorde I believe your best bet is to take the initiative and make the change yourself + open a pull request. |
are there any implications to calling e.preventDefault()? |
Without testing the code, I think it could break things like scrolling, dragging, etc. anything custom that a JS app is listening for touchstart events. |
In my project it did, when I used another prevent default to avoid links opening a new tab. (Commented the build-in standalone code, because that one didn't work for me). My project is a standalone slideshow app. So apart from some buttons and flex slider it didn't need that much custom functionality. You should try it in your code locally, see if it works out for you. On Friday 4 January 2013 at 15:56, Adam Thurlow wrote:
|
thanks @thurloat and @thomasvankerckvoorde |
Temporary I'm using this lib, https://github.com/ftlabs/fastclick. Until this one get fixed. |
@thomasvankerckvoorde i was able to drive a preventDefault off of class/id of the target.
|
I ran into a similar problem with energize.js interacting with dynamically generated elements at the position of the target element in a slow-loading environment. A button triggers an angular.js route change and the view with the source button is removed and replaced by a second view which has a new button at the same place. The new button is then triggered after route change. That behaviour is just madness. |
I've only seen tarcon's issue, which I can reproduce on my end. Can't seem to get a use case working that demonstrates the original issue described, although enough folks seem to have it. Any additional info or code would help! (sorry for the delay - have been on a LONG sabbatical) |
Whenever I programmatically create a node and bind a 'click' event, I get 'ghost clicks' on iOS - the bound event gets fired twice. This doesn't happen on elements that exist on page load. Any ideas?
The text was updated successfully, but these errors were encountered: