Last active
May 9, 2020 01:57
-
-
Save ShanonJackson/1eab9143eae9c59da5d5c9e7e57ac773 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const onPaste: React.ClipboardEventHandler = (e) => { | |
e.preventDefault(); /* Prevent the DOM Paste */ | |
// replace linebreaks | |
insertString(e.clipboardData.getData("text/plain").replace(/\r?\n|\r/g, "")); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment