Which @angular/* package(s) are the source of the bug?
animations
Is this a regression?
No
Description
If triggering an animation for a component that is currently in an inactive mat-tab
, that animation sticks to the DOM and is not removed as it should.
See the attached stackblitz.
- Click on the tab "Second" and wait 2 seconds.
- Click on the tab "First".
The result is that the div with item0
that was animated got stuck for the TestComponent
that was inside of the first mat-tab
.
Test example start

and end, where the animated div gets stuck in one of the TestComponent

Might be related to:
#53492
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/23y3d9
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version
)
No response
Anything else?
No response