6

Android default browser doesn't fire OnKeyUp events on text inputs if user types non-latin characters.

For example http://jsfiddle.net/Hzjhz/. It works for English characters but does not work for Russian and Korean characters.

Are there any ways to avoid the problem?

ygneo
  • 416
  • 3
  • 10
Egor4eg
  • 2,678
  • 1
  • 22
  • 41
  • @Péter Varga: Sorry, I meant the default Android browser. Just said 'Safari' because it uses WebKit. I changed the question and thx for the notice. – Egor4eg Mar 30 '12 at 10:37
  • yes, had u observed that, it wont return the keyvalue or keycode for the backspace also when u use the android keybord.. – Sandeep P Apr 04 '12 at 09:37
  • @Egor4eg: Did you try my solution? – PravinCG Apr 10 '12 at 11:32

3 Answers3

2

I could confirm the issue in my Nexus S phone running ICS. Even though I don't have a direct answer to this, I could suggest you some alternatives.

  1. Try to bind the onBlur event as well and you can check the data that was entered by the user.
  2. Other alternative is to bind a setTimeout on the onfocus event and try to check if the text entered by the user is changed.
Sudar
  • 18,954
  • 30
  • 85
  • 131
  • Perhaps, I will use a workaround. Actually the textbox will be used in instant search control. I'm going to add 'onclick' handler to start search as well as 'onkeyup' handler. Fortunately, my application will be used by internal users from our company and we will be able to teach them to tap on search box when it is required. – Egor4eg Apr 10 '12 at 15:16
  • It would be better to use the onFocus event rather than onclick event. It helps if someone just did a tab to get to the control instead of directly clicking/tapping on it. – Sudar Apr 11 '12 at 05:12
  • I want to tell my users to type search condition in the textbox and after that click on the textbox again. As far as I know onFocus event fires only once when user selects textbox. – Egor4eg Apr 11 '12 at 08:18
  • You can also bind the onBlur event, just incase they click some other part of the page. – Sudar Apr 11 '12 at 11:36
  • Year, I will handle 3 events: onclick,onblur and onchange. OnChange will work properly only on iOS, Windows etc. devices (except Android). – Egor4eg Apr 11 '12 at 11:55
0

Try Using onKeyMultiple for non latin IME characters. I have not used this for browser but within the application for some other use-case.

You should try this, if it works I will tell the rationale.

PravinCG
  • 7,688
  • 3
  • 30
  • 55
0

try InputEvent, it works in default Android browser. don't work in chrome

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
Sergey
  • 1