diff --git a/src/components/PasteChartDialog.tsx b/src/components/PasteChartDialog.tsx index fb024e8d..bb5bfc57 100644 --- a/src/components/PasteChartDialog.tsx +++ b/src/components/PasteChartDialog.tsx @@ -46,7 +46,7 @@ const ChartPreviewBtn = (props: { }, null, // files ); - + previewNode.replaceChildren(); previewNode.appendChild(svg); if (props.selected) { @@ -55,7 +55,7 @@ const ChartPreviewBtn = (props: { })(); return () => { - previewNode.removeChild(svg); + previewNode.replaceChildren(); }; }, [props.spreadsheet, props.chartType, props.selected]);