react-tap-event-plugin icon indicating copy to clipboard operation
react-tap-event-plugin copied to clipboard

Repeated event calls in Android WebView

Open notpushkin opened this issue 11 years ago • 5 comments

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? :)

notpushkin avatar Mar 29 '15 23:03 notpushkin

Update: reproduced as well in Android's default web browser. Raising ignoreMouseThreshold up to 1000 helped (but not in all cases :/)

notpushkin avatar Mar 30 '15 07:03 notpushkin

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.

s0meone avatar May 20 '15 13:05 s0meone

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.

overminder avatar May 22 '15 02:05 overminder

@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.

notpushkin avatar May 22 '15 11:05 notpushkin

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

s0meone avatar May 27 '15 12:05 s0meone