Created
June 11, 2019 14:29
-
-
Save philtr/70f907d1dd366c2c3f0ceb0ca8c90b87 to your computer and use it in GitHub Desktop.
Disable all the autocorrect and smart quotes for textareas on iOS
This file contains hidden or 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
<textarea id="stupid" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea> | |
<script> | |
function checkInput(e) { | |
if ((e.which == 39) || (e.which == 8216) || (e.which == 8217)) { | |
e.preventDefault(); | |
document.execCommand('insertText', 0, "'"); | |
} | |
} | |
var el = document.getElementById('stupid'); | |
el.addEventListener('keypress', checkInput, false); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment