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
fix(zone.js): should allow add passive/non-passive listeners together #49477
Draft
JiaLiPassion
wants to merge
1
commit into
angular:main
Choose a base branch
from
JiaLiPassion:allow-passive-event
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+124
−25
Conversation
This file contains 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
JiaLiPassion
added
area: zones
target: minor
This PR is targeted for the next minor release
labels
Mar 19, 2023
JiaLiPassion
force-pushed
the
allow-passive-event
branch
from
March 19, 2023 11:30
ebf8c88
to
2d51ab3
Compare
JeanMeche
reviewed
Mar 19, 2023
JiaLiPassion
force-pushed
the
allow-passive-event
branch
from
March 19, 2023 13:27
2d51ab3
to
35b973b
Compare
alfaproject
reviewed
Mar 20, 2023
JiaLiPassion
force-pushed
the
allow-passive-event
branch
3 times, most recently
from
March 25, 2023 11:47
a45dd8d
to
13247d7
Compare
JiaLiPassion
force-pushed
the
allow-passive-event
branch
from
December 14, 2023 13:47
13247d7
to
f18202b
Compare
alan-agius4
approved these changes
Dec 14, 2023
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
alan-agius4
added
target: patch
This PR is targeted for the next patch release
and removed
target: minor
This PR is targeted for the next minor release
labels
Dec 14, 2023
alan-agius4
added
the
action: global presubmit
The PR is in need of a google3 global presubmit
label
Dec 14, 2023
JiaLiPassion
force-pushed
the
allow-passive-event
branch
from
December 14, 2023 14:38
f18202b
to
1fe53a0
Compare
alan-agius4
reviewed
Dec 14, 2023
@@ -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
alan-agius4
added
the
action: cleanup
The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews
label
Dec 14, 2023
JiaLiPassion
force-pushed
the
allow-passive-event
branch
3 times, most recently
from
December 16, 2023 21:52
320ff96
to
1cadb57
Compare
alan-agius4
removed
the
action: cleanup
The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews
label
Dec 17, 2023
alan-agius4
reviewed
Dec 18, 2023
JiaLiPassion
force-pushed
the
allow-passive-event
branch
2 times, most recently
from
December 18, 2023 14:08
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
JiaLiPassion
force-pushed
the
allow-passive-event
branch
from
December 18, 2023 23:28
f174766
to
6860a6e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
action: global presubmit
The PR is in need of a google3 global presubmit
area: zones
target: patch
This PR is targeted for the next patch release
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
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.