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
@ -295,6 +295,7 @@ export class App extends React.Component<{}, AppState> {
|
|||||||
<div
|
<div
|
||||||
className="container"
|
className="container"
|
||||||
onCut={e => {
|
onCut={e => {
|
||||||
|
if (isInputLike(e.target)) return;
|
||||||
e.clipboardData.setData(
|
e.clipboardData.setData(
|
||||||
"text/plain",
|
"text/plain",
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
@ -308,6 +309,7 @@ export class App extends React.Component<{}, AppState> {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}}
|
}}
|
||||||
onCopy={e => {
|
onCopy={e => {
|
||||||
|
if (isInputLike(e.target)) return;
|
||||||
e.clipboardData.setData(
|
e.clipboardData.setData(
|
||||||
"text/plain",
|
"text/plain",
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
@ -319,6 +321,7 @@ export class App extends React.Component<{}, AppState> {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}}
|
}}
|
||||||
onPaste={e => {
|
onPaste={e => {
|
||||||
|
if (isInputLike(e.target)) return;
|
||||||
const paste = e.clipboardData.getData("text");
|
const paste = e.clipboardData.getData("text");
|
||||||
this.addElementsFromPaste(paste);
|
this.addElementsFromPaste(paste);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user