Visitar URL original
:enter animation .done callback gets triggered on element destroy · Issue #40186 · angular/angular · GitHub
The Wayback Machine - https://web.archive.org/web/20230126071821/https://github.com/angular/angular/issues/40186
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

:enter animation .done callback gets triggered on element destroy #40186

Closed
4javier opened this issue Dec 17, 2020 · 3 comments
Closed

:enter animation .done callback gets triggered on element destroy #40186

4javier opened this issue Dec 17, 2020 · 3 comments

Comments

@4javier
Copy link
Contributor

4javier commented Dec 17, 2020

🐞 bug report

Affected Package

The issue is caused by package @angular/animations

Description

Binding to .done callback of animation with :enter transition applied to a dynamically generated view, makes the callback getting triggered when the view gets destroyed.

🔬 Minimal Reproduction

https://stackblitz.com/edit/angular-ivy-s2lvp8?file=src/app/app.component.ts

🌍 Your Environment

Angular Version:


Angular CLI: 11.0.4
Node: 15.4.0
OS: linux x64

Angular: 11.0.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.4
@angular-devkit/build-angular   0.1100.4
@angular-devkit/core            11.0.4
@angular-devkit/schematics      11.0.4
@angular/cdk                    11.0.2
@schematics/angular             11.0.4
@schematics/update              0.1100.4
rxjs                            6.6.3
typescript                      4.0.5
@ngbot ngbot bot added this to the needsTriage milestone Dec 18, 2020
@4javier
Copy link
Contributor Author

4javier commented Dec 19, 2020

I think this problem is related
#21546

Could the call to finish() inside destroy()


be the culprit?

private _onFinish() {
if (!this._finished) {
this._finished = true;
this._onDoneFns.forEach(fn => fn());
this._onDoneFns = [];
}
}

@jelbourn
Copy link
Member

Duplicate of #21546

@jelbourn jelbourn marked this as a duplicate of #21546 Jan 25, 2021
@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 Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants