Skip to content

Instantly share code, notes, and snippets.

@jon-grangien
Created September 24, 2018 10:48
Show Gist options
  • Save jon-grangien/244a240da7dfc4f8fe56454c4ccff420 to your computer and use it in GitHub Desktop.
Save jon-grangien/244a240da7dfc4f8fe56454c4ccff420 to your computer and use it in GitHub Desktop.
window.stopEscapeDefault = function(e){ if(e.key === "Escape"){ e.preventDefault(); console.log("prevented defocus"); } };
// onkeydown="window.stopEscapeDefault(event)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment