Skip to content

Commit

Permalink
fix(runtime): update call to prepend to remove null node (#5946)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner-reits authored Aug 14, 2024
1 parent 37a0aaf commit 970c5d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ export const addStyle = (styleContainerNode: any, cmpMeta: d.ComponentRuntimeMet
preconnectLinks.length > 0
? preconnectLinks[preconnectLinks.length - 1].nextSibling
: document.querySelector('style');
styleContainerNode.insertBefore(styleElm, referenceNode);
(styleContainerNode as HTMLElement).insertBefore(styleElm, referenceNode);
} else if ('host' in styleContainerNode) {
/**
* if a scoped component is used within a shadow root, we want to insert the styles
* at the beginning of the shadow root node
*/
styleContainerNode.prepend(styleElm, null);
(styleContainerNode as HTMLElement).prepend(styleElm);
}
}

Expand Down

0 comments on commit 970c5d2

Please sign in to comment.