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