File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class LoadingBackdrop extends LitElement {
6464 :host([_state="shown"]) d2l-loading-spinner {
6565 opacity: 1;
6666 }
67-
67+
6868 :host([_state="hiding"]) .d2l-backdrop,
6969 :host([_state="hiding"]) d2l-loading-spinner {
7070 transition: opacity ${ FADE_DURATION_MS } ms ease-out;
@@ -111,7 +111,13 @@ class LoadingBackdrop extends LitElement {
111111 }
112112
113113 #fade( ) {
114- if ( reduceMotion || this . _state === 'showing' ) {
114+ let hideImmediately = reduceMotion || this . _state === 'showing' ;
115+ if ( this . _state === 'shown' ) {
116+ const currentOpacity = getComputedStyle ( this . shadowRoot . querySelector ( '.backdrop' ) ) . opacity ;
117+ hideImmediately ||= ( currentOpacity === '0' ) ;
118+ }
119+
120+ if ( hideImmediately ) {
115121 this . #hide( ) ;
116122 } else {
117123 this . _state = 'hiding' ;
You can’t perform that action at this time.
0 commit comments