From 9ea00bb95f044cf3bd25a06a7e6f5362422a292c Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 14 Oct 2022 14:50:19 -0600 Subject: [PATCH] Give webComponents inside nextmatch a chance to finish before we calculate sizes --- api/js/etemplate/et2_extension_nextmatch.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index a4c5761f05..d8ef2616ce 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -2442,7 +2442,23 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 this.dynheight = this._getDynheight(); } this.dynheight.initialized = false; - this.resize(); + + // Give components a chance to finish. Their size will affect available space, especially column headers. + let waitForWebComponents = []; + this.getChildren().forEach((w) => + { + // @ts-ignore + if(typeof w.updateComplete !== "undefined") + { + // @ts-ignore + waitForWebComponents.push(w.updateComplete) + } + }); + + Promise.all(waitForWebComponents).then(() => + { + this.resize(); + }); } ).finally(() => this.template_promise = null);