ngClick using ngTouch fires twice
ngTouch 1.2.1 on Safari iOS 7 fires a second time by tapping wherever on the screen:
http://jsfiddle.net/coma/2hWWa/embedded/result/
http://stackoverflow.com/questions/21708730/why-are-multiple-click-events-fired-when-using-ngtouch/21766071#21766071
I am also having hard times with this issue.
Any ideas what's causing this, and if there's a workaround that I could use?
I think it's something related to the event propagation, this is my workaround:
http://jsfiddle.net/coma/2hWWa
I have a similar problem.
My app has a popup dialog with a button that closes it. When the dialog's button is on top of a text input element, clicking the button on touch screen devices not only closes the dialog, but also focuses the input.
Same problem here using angular w/ angular-touch 1.2.9.
There is no other clickable elements in the tree to propagate to. The very same click event is fired twice in a row. This does not happen with the swipes. Also, the problem of firing ngClick events twice disappears when I remove ngTouch from the project.
I am also having this problem in ngTouch 1.2.13,
Depending on the situation, this is more than an optical bug, but in my case leads to rather annoying usability problems:
For example I change a View with activated ngTouch and with ng-click on a touch device for to open a modal, which lays it self above the clicked element. Within this modal a clickable element is at the same place as the previously clicked element (now laying above), then it could occur that the second event is fired and the button in modal is clicked/fired.
This could lead to unwanted behaviour of the application.
Hi Richard, this is exactly same same kind of problem we are facing.
Reference jquery (before angular.js) to stop the event propagation and prevent the double fires.
That doesn't sound like a fix. We do not use jQuery in our application. Is this string saying that this will not be addressed prior to 1.3?
This issue is making ngClick unusable. How are people working around this? Debounce? Fallback to original ngClick?
I added ngTouch to get swipe functionality, and now I'm saddled with this issue.
We've been running our own fork of ng-touch with the changes in https://github.com/angular/angular.js/pull/6995 Other than that, I've seen projects doing manual debouncing where clicks within ~200ms of each other are disregarded.
I'm running into this issue too. @coma's workaround seems to have fixed it.
just started using angular-material and ran into this issue since material includes aria.
+1 using material as well having the same issue.
any updates for this issue? and is there a workaround? I am using ngtouch 1.3.14 and still having this issue
+1
Any update on this issue? Developing an app using angular-material and it works great on desktop but on mobile ng-click registers twice.
In my case jquery (as a dependency of ui-calendar) caused this problem. couldn´t find a fix...
+1