From c1379c3c10f5b37d523e0548b98b06b6a60316bf Mon Sep 17 00:00:00 2001 From: David Luzar Date: Wed, 17 Mar 2021 14:43:58 +0100 Subject: [PATCH] fix: Revert `906faaf0` #3206 (#3269) --- src/actions/actionClipboard.tsx | 2 +- src/components/App.tsx | 7 ------- src/keys.ts | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/actions/actionClipboard.tsx b/src/actions/actionClipboard.tsx index 050fe3a26..fdbe41dc7 100644 --- a/src/actions/actionClipboard.tsx +++ b/src/actions/actionClipboard.tsx @@ -17,7 +17,7 @@ export const actionCopy = register({ }; }, contextItemLabel: "labels.copy", - // Don't assign keyTest since its handled via copy event + keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.code === CODES.C, }); export const actionCut = register({ diff --git a/src/components/App.tsx b/src/components/App.tsx index 6f6620244..7455e416a 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1047,13 +1047,6 @@ class App extends React.Component { }); private onCopy = withBatchedUpdates((event: ClipboardEvent) => { - const activeSelection = document.getSelection(); - if ( - activeSelection?.anchorNode && - !this.excalidrawContainerRef.current!.contains(activeSelection.anchorNode) - ) { - return; - } if (isWritableElement(event.target)) { return; } diff --git a/src/keys.ts b/src/keys.ts index d8dff5654..31baff550 100644 --- a/src/keys.ts +++ b/src/keys.ts @@ -40,7 +40,6 @@ export const KEYS = { TAB: "Tab", A: "a", - C: "c", D: "d", E: "e", L: "l",