mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
Fix copy-paste on input (#331)
If the input is active, we shouldn't override copy paste behavior
This commit is contained in:
parent
d45f48e60f
commit
dd2a7eb597
1 changed files with 3 additions and 0 deletions
|
@ -295,6 +295,7 @@ export class App extends React.Component<{}, AppState> {
|
|||
<div
|
||||
className="container"
|
||||
onCut={e => {
|
||||
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();
|
||||
|
|
Loading…
Add table
Reference in a new issue