From 93fb837c37a83400d8b964a7bf794265a010d5ce Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 13 Aug 2024 08:38:27 -0600 Subject: [PATCH] Et2Dialog: Fix some dialog events / internals --- api/js/etemplate/Et2Dialog/Et2Dialog.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/js/etemplate/Et2Dialog/Et2Dialog.ts b/api/js/etemplate/Et2Dialog/Et2Dialog.ts index dec9974ad5..64de039e3f 100644 --- a/api/js/etemplate/Et2Dialog/Et2Dialog.ts +++ b/api/js/etemplate/Et2Dialog/Et2Dialog.ts @@ -527,10 +527,12 @@ export class Et2Dialog extends Et2Widget(SlDialog) // Need to wait for Overlay async getUpdateComplete() { - await super.getUpdateComplete(); + let result = await super.getUpdateComplete(); // Wait for template to finish loading await this._template_promise; + + return result; } getComplete() : Promise<[number, Object]> @@ -553,7 +555,7 @@ export class Et2Dialog extends Et2Widget(SlDialog) }); // Now consumers can listen for "open" event, though getUpdateComplete().then(...) also works - this.dispatchEvent(new Event('open')); + this.dispatchEvent(new Event('open', {bubbles: true})); Promise.all([this._template_promise, this.updateComplete]) .then(() => this._setupMoveResize()); @@ -570,7 +572,7 @@ export class Et2Dialog extends Et2Widget(SlDialog) this.removeOpenListeners(); this._completeResolver([this._button_id, this.value]); - this.dispatchEvent(new Event('close')); + this.dispatchEvent(new Event('close', {bubbles: true})); waitForEvent(this, 'sl-after-hide').then(() => {