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

"onTouchStart" preventDefault is ignored, causes double step to happen #44

Closed
adnansorg opened this issue May 10, 2017 · 4 comments
Closed

Comments

@adnansorg
Copy link

This was tested on Chrome 58 with responsive mode switched on which means it treats clicks as touch events. This results in step being done twice on a single click.

step bug on touch

The following message gets logged in the console.

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

@odama626
Copy link

odama626 commented Jul 6, 2017

Same issue here

@lanceon
Copy link

lanceon commented Aug 13, 2017

Reproduced in react-numeric-input v2.0.9 and 2.1.0 in desktop Chrome in device mode and latest Chrome browser on Android.

@lanceon
Copy link

lanceon commented Aug 13, 2017

Hi @vlad-ignatov,

Made a quick fix on this issue according to recommendation on developers.google.com:
https://developers.google.com/web/updates/2017/01/scrolling-intervention

If your touchstart listener calls preventDefault(), ensure preventDefault() is also called from associated touchend listeners to continue suppressing the generation of click events and other default tap behavior.

Please review and merge if appropriate, this fixes the double click issue in devtools' device mode so should work on mobiles with touch events: #56

@vlad-ignatov
Copy link
Owner

This is now fixed thanks to @lanceon.

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