Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triggers twice on tap on Android devices #1

Open
lilyannh opened this issue Jan 15, 2018 · 3 comments
Open

Triggers twice on tap on Android devices #1

lilyannh opened this issue Jan 15, 2018 · 3 comments

Comments

@lilyannh
Copy link

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.

@dlee
Copy link

dlee commented Mar 22, 2018

This happens on iOS as well.

@pwanat
Copy link

pwanat commented Apr 4, 2019

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

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

@minwork
Copy link

minwork commented Apr 27, 2020

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

Surm4 pushed a commit to techsterowniki/react-repeatable that referenced this issue Aug 17, 2021
Surm4 added a commit to techsterowniki/react-repeatable that referenced this issue Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants