Skip to content

Instantly share code, notes, and snippets.

@ShanonJackson
Last active May 9, 2020 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShanonJackson/75ef059c030cf2edca9da1fe692c3c2d to your computer and use it in GitHub Desktop.
Save ShanonJackson/75ef059c030cf2edca9da1fe692c3c2d to your computer and use it in GitHub Desktop.
const onPaste = (e) => {
e.preventDefault(); /* Prevent the DOM Paste */
/* Split on line break regex */
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