From a14109d9c65c6b602ac8252e1253fdaf3629f478 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 11 Apr 2024 18:45:25 +0200 Subject: [PATCH] fix clicking on expand icon (> or v) was triggering an onclick / reloading mail folder --- api/js/etemplate/Et2Tree/Et2Tree.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Tree/Et2Tree.ts b/api/js/etemplate/Et2Tree/Et2Tree.ts index c2b7215032..b9e460af11 100644 --- a/api/js/etemplate/Et2Tree/Et2Tree.ts +++ b/api/js/etemplate/Et2Tree/Et2Tree.ts @@ -162,8 +162,9 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) //Sl-Trees handle their own onClick events _handleClick(_ev) { - //if onclick is defined, and we have a resonable target (e.g. one single item that was clicked on, trigger the onclick function - if (typeof this.onclick == "function" && typeof _ev.target.value == "string") + // check if not expand icon (> or v) was clicked, we have an onclick handler and a string value + if (!(_ev.composedPath()[0].tagName === 'svg' && _ev.composedPath()[0].classList.contains('bi-chevron-right')) && + typeof this.onclick === "function" && typeof _ev.target.value === "string") { this.onclick(_ev.target.value, this, _ev.target.value) }