From 45d63d52d67d3ccc67627cb0313fc42025fdf62d Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Tue, 7 Mar 2023 20:05:06 +0100 Subject: [PATCH] feat: check if element is in a shadowroot. --- application/source/dom/updater.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/source/dom/updater.mjs b/application/source/dom/updater.mjs index 466bc2765..7bd038194 100644 --- a/application/source/dom/updater.mjs +++ b/application/source/dom/updater.mjs @@ -543,6 +543,15 @@ function internalTemplateLookUp(container, key, ref, path) { } } + const rootNode = container.getRootNode(); + if (rootNode instanceof ShadowRoot) { + templateID = rootNode.host.getAttribute(ATTRIBUTE_UPDATER_INSERT_TEMPLATE_ID); + template = findDocumentTemplate(templateID, container); + if (template instanceof HTMLTemplateElement) { + return template; + } + } + return findDocumentTemplate(templateID, container); } -- GitLab