From 127ccdedbbbb4cd2353200e173f01046f4d594e7 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 2 Nov 2022 08:36:44 -0600 Subject: [PATCH] Et2Dialog: Fix incorrect button adoption search --- api/js/etemplate/Et2Dialog/Et2Dialog.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/Et2Dialog/Et2Dialog.ts b/api/js/etemplate/Et2Dialog/Et2Dialog.ts index 8b0f2df542..b84b79a01f 100644 --- a/api/js/etemplate/Et2Dialog/Et2Dialog.ts +++ b/api/js/etemplate/Et2Dialog/Et2Dialog.ts @@ -734,11 +734,13 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo { // Check for something with buttons slot set let search_in = this._template_widget?.DOMContainer || this._overlayContentNode._contentNode; - let template_buttons = search_in.querySelectorAll('[slot="buttons"]') || + let template_buttons = [ + ...search_in.querySelectorAll('[slot="buttons"]'), // Look for a dialog footer, which will contain several buttons and possible other widgets - search_in.querySelectorAll(".dialogFooterToolbar") || - // Look for buttons anywhere - search_in.querySelectorAll("et2-button"); + ...search_in.querySelectorAll(".dialogFooterToolbar"), + // Look for buttons at high level (not everywhere, otherwise we can't have other buttons in the template) + ...search_in.querySelectorAll(":scope > et2-button, :scope > * > et2-button") + ]; if(template_buttons) { template_buttons.forEach((button) =>