diff --git a/website/src/commands/copy.tsx b/website/src/commands/copy.tsx index 2310b17..08c5f61 100644 --- a/website/src/commands/copy.tsx +++ b/website/src/commands/copy.tsx @@ -13,16 +13,22 @@ const Button = styled.button` const CopyView: React.FC<{ command: ICommand; editorProps: IMarkdownEditor & ToolBarProps }> = (props) => { const { editorProps } = props; const handleClick = () => { - const dom = editorProps.preview.current; - dom?.focus(); - window.getSelection()?.removeAllRanges(); - let range = document.createRange(); - range.setStartBefore(dom?.firstChild!); - range.setEndAfter(dom?.lastChild!); - window.getSelection()?.addRange(range); - document.execCommand(`copy`); - window.getSelection()?.removeAllRanges(); - toast.success(