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

Force non-passive event for touch device #28

Merged
merged 1 commit into from
Sep 14, 2017
Merged

Force non-passive event for touch device #28

merged 1 commit into from
Sep 14, 2017

Conversation

smeijer
Copy link
Contributor

@smeijer smeijer commented Sep 13, 2017

Touch event listeners had a breaking change in chrome 56. Passive events became the default in Chrome 56 and up. This PR's forces the listener to be non-passive, so that preventDefault is no longer being ignored. Without it, the page wants to navigate to the next / previous page when swiping on a touch screen.

See: https://developers.google.com/web/updates/2017/01/scrolling-intervention
Related: facebook/react/#8968

Touch event listeners had a breaking change in chrome 56. Passive events became the default in Chrome 56 and up. This PR's forces the listener to be non-passive, so that `preventDefault` is no longer being ignored. Without it, the page wants to navigate to the next / previous page when swiping on a touch screen.

See: https://developers.google.com/web/updates/2017/01/scrolling-intervention
Related: facebook/react/#8968
@wangzuo
Copy link
Collaborator

wangzuo commented Sep 13, 2017

Should i add this to other touch event handlers?

@smeijer
Copy link
Contributor Author

smeijer commented Sep 13, 2017

@wangzuo , that will prevent some warnings in the console. So you can do that. This fix is purely to fix the navigation issue. Chrome want's to browse to the previous page when swiping to the right. So a time-change triggered the navigation.

More correct way of fixing those warnings; is to not preventDefault in the dragEnd handler.

@wangzuo wangzuo added the bug label Sep 14, 2017
@wangzuo wangzuo merged commit 2a7513d into swiftcarrot:master Sep 14, 2017
@wangzuo
Copy link
Collaborator

wangzuo commented Sep 14, 2017

Keep this open due to the react-dom warning facebook/react#8968

@smeijer smeijer deleted the patch-1 branch September 14, 2017 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants