I am having issues preventing the browser from creating emojis inside of 'textarea' and 'input' elements, by triggering shortcuts like 'alt + 1', 'alt + 2'.
This code prohibits any interaction with said elements, but 'alt + 1' still creates smileys. Tested on Chrome and Edge. Am I missing something?
'use strict';
(() => {
document.onkeydown = document.onkeypress = document.onkeyup = ev => {
ev.stopPropagation();
ev.preventDefault();
return false;
}
})();
https://jsfiddle.net/9Lr0hays/1/
Note: I don't want to interact with the elements directly (using selectors).
I am talking about these symbols: http://www.alt-codes.net/