You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
animations, core
Is this a regression?
No
Description
if using @if directive to show and remove an element and the exit animation is longer as compared to enter animation and we switch back the toggle to true, this add additional element to DOM again with enter animation while other element is already in leave animation
This may still be a bug. The event binding version has a different code path than the class version. If you can provide a minimal reproduction with the RC release, that would be appreciated.
Hi all, I believe current behaviour is good enough, ideally to prevent abrupt animation element should be kept in DOM on leave,
and if user opens menu while menu close animation is running we could reverse the leave animation using JS. smooth animation won't be possible if element gets removed on leave.
So the reason I didn't initially apply any fix for this on the event binding version is because the control is in the user space. If you're using a third-party animation library, Angular only knows when to remove the element by when you call the animationComplete() function. So you could track these programmatically in the app code and call them yourself. Though I think that's possibly less ideal. I think we can look at applying a similar fix for the event binding version that we did for the classes and make them consistent.
Activity
shannonvc commentedon Aug 13, 2025
This is a duplicate of #63020 and will be fixed by #63048
thePunderWoman commentedon Aug 13, 2025
This may still be a bug. The event binding version has a different code path than the class version. If you can provide a minimal reproduction with the RC release, that would be appreciated.
rupisaini123 commentedon Aug 13, 2025
here is the minimal reproduction
https://stackblitz.com/edit/stackblitz-starters-79cwhri5
Credits: https://briantree.se/angulars-new-enter-leave-animation-api/
Click the hamburger button on top left and another click to close, while it's closing click again to re-open
imaksp commentedon Aug 15, 2025
Hi, may be this can be fixed by tracking leave event in new class field and manually calling
leaveEvent.animationComplete()in enter code.imaksp commentedon Aug 15, 2025
Hi all, I believe current behaviour is good enough, ideally to prevent abrupt animation element should be kept in DOM on leave,
and if user opens menu while menu close animation is running we could reverse the leave animation using JS. smooth animation won't be possible if element gets removed on leave.
thePunderWoman commentedon Aug 18, 2025
So the reason I didn't initially apply any fix for this on the event binding version is because the control is in the user space. If you're using a third-party animation library, Angular only knows when to remove the element by when you call the
animationComplete()function. So you could track these programmatically in the app code and call them yourself. Though I think that's possibly less ideal. I think we can look at applying a similar fix for the event binding version that we did for the classes and make them consistent.fix(core): ensure animate events do not have duplicate elements
fix(core): ensure animate events do not have duplicate elements
fix(core): ensure animate events do not have duplicate elements (#63216)
fix(core): ensure animate events do not have duplicate elements (angu…
angular-automatic-lock-bot commentedon Sep 18, 2025
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.