fix(core): Prevents early style pruning with leave animations (#64335)

In some cases, the leave animation stylesheets were getting pruned too early due to the renderer removal happening before the animation function was run. This ensures that while queuing a leave animation, we guarantee the lView is referenced in the leaving animations set. This guarantees the style sheet pruning knows about the animations existing and skips the prune step.

fixes: #64326

PR Close #64335
This commit is contained in:
Jessica Janiuk
2025-10-10 11:02:42 +02:00
committed by Andrew Kushnir
parent ab415f3d7f
commit e228102378
@@ -407,6 +407,8 @@ function runLeaveAnimationsWithCallback(
return callback(false);
}
if (lView) allLeavingAnimations.add(lView);
addToAnimationQueue(injector, () => {
// it's possible that in the time between when the leave animation was
// and the time it was executed, the data structure changed. So we need