Repeated event calls in Android WebView
Touch event handlers are fired twice. Okay on PC. Haven't tried on non-Cordova mobile browsers yet.
Reproduction: https://github.com/iamale/demo-touchtapp (Probably with other Apache Cordova targets too)
P. S. There is a possibility that it's me doing something wrong. If so, could you tell me what exactly? :)
Update: reproduced as well in Android's default web browser. Raising ignoreMouseThreshold up to 1000 helped (but not in all cases :/)
Are you sure the window.alert doesn't block JS execution? Could you try to log the event's timeStamp and look at the difference. Both events will fire if the time delta is higher than the threshold.
I was experiencing the same issue. Yeah, it is caused by window.alert's blocking JS execution.. My current workaround is to drop any touchtap event that happens within a small period (~100ms) after a blocking call.
@s0meone I've tried it with some non-blocking events too. In particular, I experienced it with material-ui for React, which uses TouchTap events.
Could you try to offload the execution to the next frame? Explained here: https://github.com/zilverline/react-tap-event-plugin/issues/15#issuecomment-104204304