Skip to content

Commit

Permalink
Fix onPaste event (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid authored Jul 8, 2024
1 parent aa2b7e3 commit 1d1dbb6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,11 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(

const handlePaste = useCallback((e) => {
pasteRef.current = true;
e.preventDefault();
if (e.isDefaultPrevented()) {
return;
}

e.preventDefault();
const clipboardData = e.clipboardData;
const text = clipboardData.getData('text/plain');
document.execCommand('insertText', false, text);
Expand Down

0 comments on commit 1d1dbb6

Please sign in to comment.