Skip to content

Commit

Permalink
feat(sandbox): use cloneNode api instead of importNode for compatible (
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos authored Nov 6, 2023
1 parent e1faf3b commit d3e9872
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/big-cougars-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@qiankunjs/sandbox": patch
---

feat(sandbox): use cloneNode api instead of importNode for compatible
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export function patchStandardSandbox(

// micro app rendering should wait unit the rebuilding link element is loaded, otherwise it may cause style blink
// As one link element will just trigger loaded event once, although we append it multiple times, we need to clone it before every appending
const cloneStyleElement = document.importNode(stylesheetElement) as HTMLLinkElement;
const cloneStyleElement = stylesheetElement.cloneNode(true) as HTMLLinkElement;
const deferred = new Deferred<boolean>();
if (cloneStyleElement.rel === 'stylesheet' && cloneStyleElement.href) {
cloneStyleElement.onload = () => deferred.resolve(true);
Expand Down

0 comments on commit d3e9872

Please sign in to comment.