1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    0
    giggle16 is on a distinguished road

      0  

    Default Unanswered: addKeyPressHandler in textfield does not work in chrome

    Unanswered: addKeyPressHandler in textfield does not work in chrome


    i have added an addKeyPressHandler in textfield,but it doest not work in chrome while in IE9 it works fine.
    is there any problem in my code like this:
    Code:
    usernameField.addKeyPressHandler(new KeyPressHandler() {            
         @Override
          public void onKeyPress(KeyPressEvent event) {
           if(event.getNativeEvent().getCharCode()+=KeyCodes.KEY_ENTER)
                    {
                        pwdField.focus();
                    }
                }
            });

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    It doesn't seem to be legal Java:
    Code:
           if(event.getNativeEvent().getCharCode()+=KeyCodes.KEY_ENTER)
    Assuming that is supposed to be '==' instead, you might be running into cross browser keydown vs keypress issues. Here's a post discussing this on SO: http://stackoverflow.com/questions/9...king-in-chrome

    From http://www.quirksmode.org/dom/events/keys.html it is suggested the IE is wrong here, not Chrome:
    Special keys

    When the user presses special keys such as the arrow keys, the browser should NOT fire keypress events.
    So try listening to keyup events instead.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi