From 850c8aea7f3d9c46ff8e98bde936b92282376dae Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 29 Aug 2023 19:13:46 -0700 Subject: fix: :bug: fix inability to copy/paste when ipynb is open --- extension/react-app/src/components/Layout.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'extension/react-app/src/components') diff --git a/extension/react-app/src/components/Layout.tsx b/extension/react-app/src/components/Layout.tsx index 143b2302..500dc921 100644 --- a/extension/react-app/src/components/Layout.tsx +++ b/extension/react-app/src/components/Layout.tsx @@ -101,6 +101,15 @@ const Layout = () => { if (event.metaKey && event.altKey && event.code === "KeyN") { client?.loadSession(undefined); } + if (event.metaKey && event.code === "KeyC") { + const selection = window.getSelection()?.toString(); + if (selection) { + // Copy to clipboard + setTimeout(() => { + navigator.clipboard.writeText(selection); + }, 100); + } + } }; window.addEventListener("keydown", handleKeyDown); -- cgit v1.2.3-70-g09d2