From ecd7b4557dc2c62d535e959dc001d8a34b44ac65 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 14 Aug 2024 12:57:44 -0600 Subject: [PATCH] Et2Tabs: Better handling of fallback tab sizing Now considering tab may be bigger than parent --- api/js/etemplate/Layout/Et2Tabs/Et2Tabs.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Layout/Et2Tabs/Et2Tabs.ts b/api/js/etemplate/Layout/Et2Tabs/Et2Tabs.ts index d82286fe6b..94f900495f 100644 --- a/api/js/etemplate/Layout/Et2Tabs/Et2Tabs.ts +++ b/api/js/etemplate/Layout/Et2Tabs/Et2Tabs.ts @@ -235,10 +235,11 @@ export class Et2Tabs extends Et2InputWidget(SlTabGroup) implements et2_IResizeab } walk(firstTab); await Promise.all(wait); - + const maxHeight = getComputedStyle(this.shadowRoot.querySelector('.tab-group__body')).height; const initial = firstTab.hasAttribute("active"); firstTab.setAttribute("active", ''); - this.tabHeight = getComputedStyle(firstTab).height; + const tabHeight = getComputedStyle(firstTab).height; + this.tabHeight = maxHeight != '0px' && parseInt(maxHeight) < parseInt(tabHeight) ? maxHeight : tabHeight; if(!initial) { firstTab.removeAttribute("active");