From 9f0daf546896a0b90138122e28f0c1d00fc27ad6 Mon Sep 17 00:00:00 2001 From: Max Weinbrown Date: Sun, 23 Nov 2025 17:22:16 -0500 Subject: [PATCH] Update injectStyle function to accept ShadowRoot The current implementation doesn't seem to correctly add the css into the shadow root of the test page --- src/widget/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widget/index.tsx b/src/widget/index.tsx index 6c36881..257ecf8 100644 --- a/src/widget/index.tsx +++ b/src/widget/index.tsx @@ -24,7 +24,7 @@ function onReady() { ); shadow.appendChild(shadowRoot); - injectStyle(shadowRoot); + injectStyle(shadow); hydrateRoot(shadowRoot, component); document.body.appendChild(element); @@ -33,7 +33,7 @@ function onReady() { } } -function injectStyle(shadowRoot: HTMLElement) { +function injectStyle(shadow: ShadowRoot) { const link = document.createElement('link'); link.rel = 'stylesheet'; const fileName = process.env.WIDGET_NAME || 'widget'; @@ -52,4 +52,4 @@ function getClientKey() { return clientKey; } -initializeWidget(); \ No newline at end of file +initializeWidget();