Skip to content

Angular never removes style tags on destroy if any component has (animate.leave) hook #66244

Description

@bukharin

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

If any component has a (animate.leave) hook - Angular does not remove style tags from head during renderer destroy

Please see reproduction example, if you remove (animate.leave) hook from TestComponent - background color will change when components destroys.

I expect that Angular remove style tags after all leave animations ends.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-fiddle-gqwykbhz-xf3v3hkw?file=src%2Fapp%2Ftest.component.ts

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)

Any Angular 20.2+ version

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimecore: animationsIssues related to `animate.enter` and `animate.leave`

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions