Skip to content

Commit

Permalink
Merge branch 'main' into ghworkflow/package_lock_auto_update
Browse files Browse the repository at this point in the history
  • Loading branch information
margaree authored Jan 17, 2025
2 parents f3ed05a + 36af27e commit 7be0ebe
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .lmsrelease
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.25.2
20.25.3
13 changes: 7 additions & 6 deletions components/dialog/dialog-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
});
}

async waitForUpdateComplete() {
const predicate = () => true;
const composedChildren = getComposedChildren(this, predicate);
await Promise.all(composedChildren.map(child => waitForElem(child, predicate)));
}

_addHandlers() {
window.addEventListener('resize', this._updateSize);
this.addEventListener('touchstart', this._handleTouchStart);
Expand Down Expand Up @@ -455,7 +461,7 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {

const flag = window.D2L?.LP?.Web?.UI?.Flags.Flag('GAUD-7397-dialog-resize-update-complete', true) ?? true;
if (flag) {
await this.#waitForUpdateComplete();
await this.waitForUpdateComplete();
await this._updateSize();
}
/** Dispatched when the dialog is opened */
Expand Down Expand Up @@ -587,9 +593,4 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
});
}

async #waitForUpdateComplete() {
const predicate = () => true;
const composedChildren = getComposedChildren(this, predicate);
await Promise.all(composedChildren.map(child => waitForElem(child, predicate)));
}
};
7 changes: 6 additions & 1 deletion components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ class Dialog extends PropertyRequiredMixin(LocalizeCoreElement(AsyncContainerMix
super.updated(changedProperties);
if (!changedProperties.has('asyncState')) return;
if (this.asyncState === asyncStates.complete) {
this.resize();
const flag = window.D2L?.LP?.Web?.UI?.Flags.Flag('GAUD-7397-dialog-resize-update-complete', true) ?? true;
if (flag) {
this.waitForUpdateComplete().then(() => this.resize());
} else {
this.resize();
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@brightspace-ui/core",
"version": "3.79.8",
"version": "3.80.0",
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
"type": "module",
"repository": "https://github.com/BrightspaceUI/core.git",
Expand Down

0 comments on commit 7be0ebe

Please sign in to comment.