react-repeatable
react-repeatable copied to clipboard
Triggers twice on tap on Android devices
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.
This happens on iOS as well.
This still happens. A quick workaround is to remove onPress and use OnClick+onTouchStart:
onTouchStart={(event) => event.preventDefault}
onClick={() => this.myFunction()}
onHold={() => this.muFunction()}
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