File tree 2 files changed +13
-7
lines changed
2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,12 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
149
149
} ) ;
150
150
}
151
151
152
+ async waitForUpdateComplete ( ) {
153
+ const predicate = ( ) => true ;
154
+ const composedChildren = getComposedChildren ( this , predicate ) ;
155
+ await Promise . all ( composedChildren . map ( child => waitForElem ( child , predicate ) ) ) ;
156
+ }
157
+
152
158
_addHandlers ( ) {
153
159
window . addEventListener ( 'resize' , this . _updateSize ) ;
154
160
this . addEventListener ( 'touchstart' , this . _handleTouchStart ) ;
@@ -455,7 +461,7 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
455
461
456
462
const flag = window . D2L ?. LP ?. Web ?. UI ?. Flags . Flag ( 'GAUD-7397-dialog-resize-update-complete' , true ) ?? true ;
457
463
if ( flag ) {
458
- await this . # waitForUpdateComplete( ) ;
464
+ await this . waitForUpdateComplete ( ) ;
459
465
await this . _updateSize ( ) ;
460
466
}
461
467
/** Dispatched when the dialog is opened */
@@ -587,9 +593,4 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
587
593
} ) ;
588
594
}
589
595
590
- async #waitForUpdateComplete( ) {
591
- const predicate = ( ) => true ;
592
- const composedChildren = getComposedChildren ( this , predicate ) ;
593
- await Promise . all ( composedChildren . map ( child => waitForElem ( child , predicate ) ) ) ;
594
- }
595
596
} ;
Original file line number Diff line number Diff line change @@ -205,7 +205,12 @@ class Dialog extends PropertyRequiredMixin(LocalizeCoreElement(AsyncContainerMix
205
205
super . updated ( changedProperties ) ;
206
206
if ( ! changedProperties . has ( 'asyncState' ) ) return ;
207
207
if ( this . asyncState === asyncStates . complete ) {
208
- this . resize ( ) ;
208
+ const flag = window . D2L ?. LP ?. Web ?. UI ?. Flags . Flag ( 'GAUD-7397-dialog-resize-update-complete' , true ) ?? true ;
209
+ if ( flag ) {
210
+ this . waitForUpdateComplete ( ) . then ( ( ) => this . resize ( ) ) ;
211
+ } else {
212
+ this . resize ( ) ;
213
+ }
209
214
}
210
215
}
211
216
You can’t perform that action at this time.
0 commit comments