Reputation: 1794
$(window).keypress(function(event) {
alert(event.which);
}
On IOS 7, this works when using system default IME, but doesn't work when using third party IME. It seems the third party IME doesn't send keydown/keyup/keypress event.
Any workaround to monitor an Enter key pressed?
P.S. This issue is similar to iOS 8 3rd party keyboards don't register javascript/jQuery keyup, keypress, keydown etc, but any workaround to monitor 'Enter' key pressed event?
Upvotes: 0
Views: 1666
Reputation: 1794
I figure out a workaround
$("#textarea").on('input propertychange paste',function(e){
var input = e.currentTarget.value;
if(input[input.lenght -1] == '\n') {
//do something
}
})
Upvotes: 1