From b66b6eb492ab05987baf03abf98b1b155974c634 Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Sun, 5 Nov 2023 16:27:49 +0100 Subject: [PATCH] fix: only 10 tabs can be activated #129 --- source/components/form/tabs.mjs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/source/components/form/tabs.mjs b/source/components/form/tabs.mjs index 8da8affd1..2d1c1137c 100644 --- a/source/components/form/tabs.mjs +++ b/source/components/form/tabs.mjs @@ -392,7 +392,7 @@ function togglePopper() { /** * @private */ -function attachResizeObserver() {; +function attachResizeObserver() { // against flickering this[resizeObserverSymbol] = new ResizeObserver((entries) => { @@ -417,7 +417,7 @@ function attachResizeObserver() {; /** * @private */ -function attachTabChangeObserver() {; +function attachTabChangeObserver() { // against flickering new MutationObserver((mutations) => { @@ -504,6 +504,7 @@ function show(element) { const nodes = getSlottedElements.call(this); for (const node of nodes) { const id = node.getAttribute("id"); + if (id === reference) { node.classList.add("active"); @@ -518,7 +519,12 @@ function show(element) { } const options = this.getOption("fetch", {}); - loadAndAssignContent(node, url, options); + const filter = undefined; + loadAndAssignContent(node, url, options,filter).then(() => { + + }).catch(e=>{ + addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message); + }); } } else { node.classList.remove("active"); @@ -526,14 +532,14 @@ function show(element) { } const standardButtons = this.getOption("buttons.standard"); - for (const [index] in standardButtons) { + for (const index in standardButtons) { const button = standardButtons[index]; const state = button["reference"] === reference ? "active" : "inactive"; this.setOption(`buttons.standard.${index}.state`, state); } const popperButton = this.getOption("buttons.popper"); - for (const [index] in popperButton) { + for (const index in popperButton) { const button = popperButton[index]; const state = button["reference"] === reference ? "active" : "inactive"; this.setOption(`buttons.popper.${index}.state`, state); @@ -773,7 +779,7 @@ function initTabButtons() {; }); } - return; + return Promise.resolve(); }); } -- GitLab