react-repeatable icon indicating copy to clipboard operation
react-repeatable copied to clipboard

Triggers twice on tap on Android devices

Open lilyannh opened this issue 7 years ago • 3 comments

onPress and onRelease are triggered twice in Android devices. You can see it in your demo, in inspector tools, if you toggle the device to any mobile device, the console will show onPress and onRelease twice.

On an actual Android device, it seems that the onPress action is triggered once on touch start, and once on touch end. This double tapping behavior did not happen on an iPad.

lilyannh avatar Jan 15 '18 23:01 lilyannh

This happens on iOS as well.

dlee avatar Mar 22 '18 11:03 dlee

This still happens. A quick workaround is to remove onPress and use OnClick+onTouchStart:

onTouchStart={(event) => event.preventDefault}
onClick={() => this.myFunction()}
onHold={() =>  this.muFunction()}

pwanat avatar Apr 04 '19 08:04 pwanat

Hey, if you want an ability to adjust events detected between click or touch (or both for that matter) you can do that using the hook I wrote https://www.npmjs.com/package/use-long-press

minwork avatar Apr 27 '20 08:04 minwork