jquery-console
jquery-console copied to clipboard
Remove depreciated Keypress event that doesn't work on android browsers
This branch update removes the onkeypress event.
Most logic is moved into the on keydown event.
At the onkeydown event, the current value of the typer is cached, then at the "input" event the current value is compared to the cached value, this will result in whatever the last character typed was, this character is inserted.
All control keys retain functionality.
Tested on Chrome, Android Chrome, iOS safari.
Thanks to this article for the inspiration for a solution!
https://www.outsystems.com/blog/javascript-events-unmasked-how-to-create-input-mask-for-mobile.html
Hi @dan2600. I've been testing this and apparently everything is working as expected. I would love to see this one merged.
I would suggest to re order the code a bit, so the diff between the new version and the previous one isn't so big. This way the real changes are hard to track. Also i think you meant deprecated on the title.
Thanks for this fix!