Skip to content

Commit

Permalink
fix(): setting outHTML after parent of the node is unmounted
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineYANG authored and ObservedObserver committed Jan 3, 2023
1 parent de1a3d3 commit 50f18bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/graphic-walker/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export const GraphicWalker: React.FC<EditorProps> = props => {
for (const node of shadowRoot.children) {
node.remove();
}
// @see https://stackoverflow.com/questions/20090059/how-to-remove-a-shadow-root-from-an-html-element-adorned-with-a-shadow-dom-from/57583697#57583697
container.outerHTML = container.outerHTML;
try {
// @see https://stackoverflow.com/questions/20090059/how-to-remove-a-shadow-root-from-an-html-element-adorned-with-a-shadow-dom-from/57583697#57583697
container.outerHTML = container.outerHTML;
} catch {}
DOM.setBody(document.body);
DOM.setHead(document.head);
};
Expand Down

0 comments on commit 50f18bb

Please sign in to comment.