-
Notifications
You must be signed in to change notification settings - Fork 26.5k
fix(zone.js): should allow add passive/non-passive listeners together #49477
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
Conversation
ebf8c88
to
2d51ab3
Compare
2d51ab3
to
35b973b
Compare
a45dd8d
to
13247d7
Compare
13247d7
to
f18202b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One NIT
f18202b
to
1fe53a0
Compare
@@ -104,12 +104,25 @@ export function patchEventTarget( | |||
const PREPEND_EVENT_LISTENER = 'prependListener'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change breaks a large number of apps in Google.
Error:
TypeError: task.callback.apply is not a function
at _ZoneDelegate.invokeTask (third_party/javascript/angular2/rc/packages/zone.js/lib/zone.ts?l=1187
320ff96
to
1cadb57
Compare
8caae4f
to
f174766
Compare
In the current version, if we add both `passive` and `not passive` listeners for the same eventName together, they will be registered with all passive or all non passive listeners depends on the order. ``` import 'zone.js'; div1.addEventListener('mousemove', (ev) => {}, { passive: true }); div1.addEventListener('mousemove', (ev) => { ev.preventDefault(); // throws error since this one is also be registered as a passive event handler }); div2.addEventListener('mousemove', (ev) => { }); div2.addEventListener('mousemove', (ev) => { ev.preventDefault(); // will not throw error since this one is also be registered as non passive event handler }, { passive: true }); ``` So this PR fix this issue and allow both passive and non-passive listeners registeration together whatever the order. PR closes angular#45020
f174766
to
6860a6e
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Close #45020
In the current version, if we add both
passive
andnot passive
listeners for the same eventName together, they will be registered with all passive or all non passive listeners depends on the order.So this PR fix this issue and allow both passive and non-passive listeners registeration together whatever the order.