fix(zone.js): should allow add passive/non-passive listeners together#49477
Closed
JiaLiPassion wants to merge 1 commit intoangular:mainfrom
Closed
fix(zone.js): should allow add passive/non-passive listeners together#49477JiaLiPassion wants to merge 1 commit intoangular:mainfrom
JiaLiPassion wants to merge 1 commit intoangular:mainfrom
Conversation
ebf8c88 to
2d51ab3
Compare
JeanMeche
reviewed
Mar 19, 2023
2d51ab3 to
35b973b
Compare
alfaproject
reviewed
Mar 20, 2023
a45dd8d to
13247d7
Compare
13247d7 to
f18202b
Compare
Contributor
f18202b to
1fe53a0
Compare
alan-agius4
reviewed
Dec 14, 2023
Contributor
There was a problem hiding this comment.
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
Contributor
alan-agius4
reviewed
Dec 18, 2023
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
Contributor
This was referenced Apr 24, 2024
Closed
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #45020
In the current version, if we add both
passiveandnot passivelisteners 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.