Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/platform-browser/src/dom/shared_styles_host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export class SharedStylesHost implements OnDestroy {
if (existingStyleElement) {
return existingStyleElement;
}

const styleNodesInDOM = this.styleNodesInDOM;
const styleEl = styleNodesInDOM?.get(style);
if (styleEl?.parentNode === host) {
Expand Down Expand Up @@ -166,6 +167,8 @@ export class SharedStylesHost implements OnDestroy {
styleEl.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);
}

host.appendChild(styleEl);

return styleEl;
}
}
Expand All @@ -175,8 +178,6 @@ export class SharedStylesHost implements OnDestroy {
const styleResult = styleRef.get(style)!; // This will always be defined in `changeUsageCount`
const styleEl = this.getStyleElement(host, style, styleResult.elements);

host.appendChild(styleEl);

if (styleResult.usage === 0) {
disableStylesheet(styleEl);
} else {
Expand Down