OnKeyUp event in Android browser for non-latin languages
Asked Answered
E

3

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?

Enhanced answered 29/3, 2012 at 14:24 Comment(3)
@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.Enhanced
yes, had u observed that, it wont return the keyvalue or keycode for the backspace also when u use the android keybord..Heterogeneous
@Egor4eg: Did you try my solution?Sheikdom
Y
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.
Yeseniayeshiva answered 9/4, 2012 at 15:35 Comment(5)
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.Enhanced
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.Yeseniayeshiva
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.Enhanced
You can also bind the onBlur event, just incase they click some other part of the page.Yeseniayeshiva
Year, I will handle 3 events: onclick,onblur and onchange. OnChange will work properly only on iOS, Windows etc. devices (except Android).Enhanced
S
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.

Sheikdom answered 9/4, 2012 at 15:48 Comment(1)
I've tried it. Id didn't work. 'onKeyMultiple' event is not fired in browser.Enhanced
C
0

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

Corves answered 6/8, 2012 at 7:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.