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

Passive or non-passive event listeners #4192

Open
ffMathy opened this issue May 1, 2018 · 3 comments
Open

Passive or non-passive event listeners #4192

ffMathy opened this issue May 1, 2018 · 3 comments

Comments

@ffMathy
Copy link

ffMathy commented May 1, 2018

It would be nice if we could set the event handlers created to be passive or non-passive. That way we can also get rid of a warning in Chrome when working with events.

@jgonggrijp
Copy link
Collaborator

Please forgive my ignorance, but isn't an event listener always passive? I've never heard of this distinction before.

@jgonggrijp jgonggrijp added this to Fridge in Dusting off Jan 2, 2022
@Rayraz
Copy link

Rayraz commented Jan 2, 2022

If I'm not mistaken, passive event listeners cannot cancel the events they receive, while active ones can.

Edit: I recalled it had something to do with scroll performance, turns out I was right: https://developers.google.com/web/updates/2016/06/passive-event-listeners

These days Chrome throws a warning if you use a non-passive event listener for an event that's potentially scroll-blocking, such as a touch event.

@jgonggrijp
Copy link
Collaborator

Thanks @Rayraz for jumping in, that really helps!

I studied the topic a bit and concluded that it's probably best to wait for jquery/jquery#2871 to be resolved before implementing support in Backbone.

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

No branches or pull requests

3 participants