It's been well documented that Chrome in Android doesn't support keydown and keyup events. I'm using jQuery to attach an event listener to a text area like this:
$textarea.on('keyup', function(e) {
alert(e.key);
}
also tried:
$textarea.on('keydown', function(e) {
alert(e.key);
}
$this is the text area. The event doesn't return anything useful. Check out the event object:
Object
altKey: false
bubbles: true
cancelable: true
char: undefined
charCode: 0
ctrlKey: false
currentTarget: HTMLTextAreaElement
data: undefined
delegateTarget: HTMLTextAreaElement
eventPhase: 2
handleObj: Object
isDefaultPrevented: function returnFalse() {
jQuery21102996875715907663: true
key: undefined
keyCode: 0
metaKey: false
originalEvent: KeyboardEvent
relatedTarget: undefined
shiftKey: false
target: HTMLTextAreaElement
timeStamp: 1412092745055
type: "keydown"
view: Window
which: 0
__proto__: —
Notice how any of the key values are not defined. This was for simply tapping the letter "A". Is there something I'm doing wrong?
Does anyone know if there is a work around for this? I'm using jQuery Mobile 1.4.2 to style the textarea. Does that have anything to do with that?
I'm open to non-jQuery options as well, if there are any...