From cb1a330983a081df2536710396f87500ca1e7ecf Mon Sep 17 00:00:00 2001 From: Sli Date: Thu, 7 May 2026 11:33:51 +0200 Subject: [PATCH] Fix component nesting bug --- core/static/bundled/core/components/include-index.ts | 10 +++------- core/static/bundled/core/components/tabs-index.ts | 4 ++-- core/static/bundled/utils/web-components.ts | 11 +++++++++++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/core/static/bundled/core/components/include-index.ts b/core/static/bundled/core/components/include-index.ts index fa046850..9ee44bb8 100644 --- a/core/static/bundled/core/components/include-index.ts +++ b/core/static/bundled/core/components/include-index.ts @@ -84,11 +84,7 @@ const refreshElement = < return; } - // This might be called at some bad timing - // This prevents crashes of the observer - if (element.refresh) { - element.refresh(); - } + element.refresh(); } }; @@ -134,7 +130,7 @@ startObserver(observer); export class LinkOnce extends elementOnce("link") { getElementQuerySelector(): string { // We get href from node.attributes instead of node.href to avoid getting the domain part - return `link[href='${this.node.attributes.getNamedItem("href")?.nodeValue}']`; + return `link[href='${this.node.attributes.getNamedItem("href").nodeValue}']`; } } @@ -146,6 +142,6 @@ export class LinkOnce extends elementOnce("link") { export class ScriptOnce extends inheritHtmlElement("script") { getElementQuerySelector(): string { // We get href from node.attributes instead of node.src to avoid getting the domain part - return `script[src='${this.node.attributes.getNamedItem("src")?.nodeValue}']`; + return `script[src='${this.node.attributes.getNamedItem("src").nodeValue}']`; } } diff --git a/core/static/bundled/core/components/tabs-index.ts b/core/static/bundled/core/components/tabs-index.ts index 7bd85998..260467d5 100644 --- a/core/static/bundled/core/components/tabs-index.ts +++ b/core/static/bundled/core/components/tabs-index.ts @@ -28,7 +28,7 @@ export class Tab extends HTMLElement { return html`