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

web-sys event listeners are passive by default causing unexpected behavior #952

Closed
jstarry opened this issue Feb 15, 2020 · 2 comments
Closed
Labels

Comments

@jstarry
Copy link
Member

jstarry commented Feb 15, 2020

Problem

When event listeners are passive, it's not possible to call event.prevent_default(). This behavior is confusing and unexpected.

Proposed Solution

We should only set passive event listeners for touchstart and touchmove. See here: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Improving_scrolling_performance_with_passive_listeners

@jetli
Copy link
Contributor

jetli commented Feb 22, 2020

@jstarry @tarkah
Sent a PR: #958, please help review.
not sure simply use $name == "touchstart" || $name == "touchmove" or setup a static HashSet like LISTENER_SET for the checking.

@jstarry
Copy link
Member Author

jstarry commented Feb 23, 2020

Fixed by #958

@jstarry jstarry closed this as completed Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants