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

Make all listeners non-passive #52

Closed
wants to merge 1 commit into from
Closed

Make all listeners non-passive #52

wants to merge 1 commit into from

Conversation

samal-rasmussen
Copy link

Listeners are non-passive by default. But it is possible to use something like https://github.com/zzarcon/default-passive-events to make listeners passive by default. In this case one must be explicit with where one wants non-passive listeners.

Fixes: #51

Listeners are *non*-passive by default. But it is possible to use something like https://github.com/zzarcon/default-passive-events to make listeners passive by default. In this case one must be explicit with where one wants *non*-passive listeners.

Fixes: #51
@mbostock
Copy link
Member

mbostock commented Apr 17, 2018

Thank you for the pull request! However, these listeners use event.preventDefault and thus cannot be made passive listeners.

Edit: Oops, misread the change. Sorry.

@mbostock mbostock closed this Apr 17, 2018
@mbostock mbostock reopened this Apr 17, 2018
@mbostock
Copy link
Member

(Ahem, take two.) Thank you for the pull request! As you say, event listeners are not passive by default. Yes, we could explicitly declare that our listeners are not passive, but this is unnecessary as that is the default behavior of eventTarget.addEventListener.

The default-passive-events library deviates from the standard by changing the default to passive. D3 is coded to web standards and unfortunately it is not feasible for me to accommodate libraries that intentionally deviate from standard behavior. Sorry!

@samal-rasmussen
Copy link
Author

Good to know. Thanks for the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants