From dd2a7eb5972fc5070f225f345a9f5d481fda19ac Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sat, 11 Jan 2020 20:41:47 -0800 Subject: [PATCH] Fix copy-paste on input (#331) If the input is active, we shouldn't override copy paste behavior --- src/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 20c2610b..1615b1f7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -295,6 +295,7 @@ export class App extends React.Component<{}, AppState> {
{ + if (isInputLike(e.target)) return; e.clipboardData.setData( "text/plain", JSON.stringify( @@ -308,6 +309,7 @@ export class App extends React.Component<{}, AppState> { e.preventDefault(); }} onCopy={e => { + if (isInputLike(e.target)) return; e.clipboardData.setData( "text/plain", JSON.stringify( @@ -319,6 +321,7 @@ export class App extends React.Component<{}, AppState> { e.preventDefault(); }} onPaste={e => { + if (isInputLike(e.target)) return; const paste = e.clipboardData.getData("text"); this.addElementsFromPaste(paste); e.preventDefault();