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

fix(core): Ensure OnPush ancestors are marked dirty when events occur #39833

Closed
wants to merge 1 commit into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Nov 25, 2020

We currently only wrap the event listener in the function which ensures
ancestors are marked for check when the listener is placed on an element
that has a native method for listening to an event. We actually need to do
this wrapping in all cases so that events that are attached to non-rendered
template items (ng-template and ng-container) also mark ancestors for check
when they receive the event.

fixes #39832

We currently only wrap the event listener in the function which ensures
ancestors are marked for check when the listener is placed on an element
that has a native method for listening to an event. We actually need to do
this wrapping in all cases so that events that are attached to non-rendered
template items (`ng-template` and `ng-container`) also mark ancestors for check
when they receive the event.

fixes angular#39832
@atscott atscott added type: bug/fix area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release engine: ivy labels Nov 25, 2020
@atscott atscott requested a review from mhevery November 25, 2020 01:24
@ngbot ngbot bot modified the milestone: needsTriage Nov 25, 2020
@google-cla google-cla bot added the cla: yes label Nov 25, 2020
@atscott atscott removed the request for review from mhevery November 25, 2020 01:24
@atscott
Copy link
Contributor Author

atscott commented Nov 25, 2020

presubmit

@atscott atscott requested a review from mhevery November 25, 2020 17:56
@atscott atscott marked this pull request as ready for review November 25, 2020 17:56
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Nov 25, 2020
@ngbot
Copy link

ngbot bot commented Nov 25, 2020

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "ci/circleci: test_aio_local_viewengine" is failing
    pending missing required status "ci/circleci: publish_snapshot"

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

jessicajaniuk pushed a commit that referenced this pull request Nov 25, 2020
…#39833)

We currently only wrap the event listener in the function which ensures
ancestors are marked for check when the listener is placed on an element
that has a native method for listening to an event. We actually need to do
this wrapping in all cases so that events that are attached to non-rendered
template items (`ng-template` and `ng-container`) also mark ancestors for check
when they receive the event.

fixes #39832

PR Close #39833
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime cla: yes target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Event listeners do not mark component as dirty when attached to ng-template
2 participants