File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
core/src/components/modal Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1044,6 +1044,7 @@ export class Modal implements ComponentInterface, OverlayInterface {
10441044 }
10451045
10461046 private cleanupViewTransitionListener ( ) {
1047+ const hasCardView = ! ! this . resizeListener ;
10471048 if ( this . resizeListener ) {
10481049 window . removeEventListener ( 'resize' , this . resizeListener ) ;
10491050 this . resizeListener = undefined ;
@@ -1053,6 +1054,15 @@ export class Modal implements ComponentInterface, OverlayInterface {
10531054 this . viewTransitionAnimation . destroy ( ) ;
10541055 this . viewTransitionAnimation = undefined ;
10551056 }
1057+
1058+ if ( hasCardView ) {
1059+ // If we had a card view, let's trigger the view transition
1060+ // one last time to make sure we're in the right state.
1061+ // This will prevent tricky things like resizing the modal causing
1062+ // it to dismiss programatically too quickly and preventing the view transition
1063+ // from being applied.
1064+ this . handleViewTransition ( ) ;
1065+ }
10561066 }
10571067
10581068 render ( ) {
You can’t perform that action at this time.
0 commit comments