From f4466a01b4136eb506f743e3447b0ac4400123ec Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 20 Mar 2024 14:22:43 -0600 Subject: [PATCH] Et2VfsSelectButton: Fix slotted custom dialog did not actually work --- api/js/etemplate/Et2Vfs/Et2VfsSelectButton.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Vfs/Et2VfsSelectButton.ts b/api/js/etemplate/Et2Vfs/Et2VfsSelectButton.ts index 2f9d465454..f56e34f031 100644 --- a/api/js/etemplate/Et2Vfs/Et2VfsSelectButton.ts +++ b/api/js/etemplate/Et2Vfs/Et2VfsSelectButton.ts @@ -78,7 +78,11 @@ export class Et2VfsSelectButton extends Et2InputWidget(LitElement) protected readonly hasSlotController = new HasSlotController(this, ''); protected processingPromise : Promise = null; - get _dialog() : Et2VfsSelectDialog {return this.shadowRoot.querySelector("et2-vfs-select-dialog") ?? null}; + get _dialog() : Et2VfsSelectDialog + { + return this.hasSlotController.test("[default]") ? this.querySelector("*") : + this.shadowRoot.querySelector("et2-vfs-select-dialog") ?? null + }; constructor() { @@ -217,7 +221,8 @@ export class Et2VfsSelectButton extends Et2InputWidget(LitElement) ${processing ? html` ` : nothing} - ${hasUserDialog ? nothing : this.dialogTemplate()} + ${hasUserDialog ? html` + ` : this.dialogTemplate()} `; } }