File tree 1 file changed +10
-1
lines changed
packages/animations/browser/src/render
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -665,7 +665,16 @@ export class TransitionAnimationEngine {
665
665
// code does not contain any animation code in it, but it is
666
666
// just being called so that the node is marked as being inserted
667
667
if ( namespaceId ) {
668
- this . _fetchNamespace ( namespaceId ) . insertNode ( element , parent ) ;
668
+ const ns = this . _fetchNamespace ( namespaceId ) ;
669
+ // This if-statement is a workaround for router issue #21947.
670
+ // The router sometimes hits a race condition where while a route
671
+ // is being instantiated a new navigation arrives, triggering leave
672
+ // animation of DOM that has not been fully initialized, until this
673
+ // is resolved, we need to handle the scenario when DOM is not in a
674
+ // consistent state during the animation.
675
+ if ( ns ) {
676
+ ns . insertNode ( element , parent ) ;
677
+ }
669
678
}
670
679
671
680
// only *directives and host elements are inserted before
You can’t perform that action at this time.
0 commit comments