Skip to content

An open source alternative to Tableau. Embeddable visual analytic

fix(): setting outHTML after parent of the node is unmounted

kyusho50f18bb26ef0
diff --git a/packages/graphic-walker/src/index.tsx b/packages/graphic-walker/src/index.tsx
index 4feae83f..efd9f76d 100644
--- a/packages/graphic-walker/src/index.tsx
+++ b/packages/graphic-walker/src/index.tsx
@@ -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);
};