PDA

View Full Version : [ExtJs 4.2] Typing - returns 173 on keydownevent on datefield, FireFox 20.0.1



tvanzoelen
15 Apr 2013, 6:53 AM
Ext version tested 4.2.0

Browser versions tested against:
Firefox 20.0.1


Description:
KeyCode 173 thrown on a datefield keydown event when entering a - (keyboard minus(not numpad))

Steps to reproduce the problem:
Type a - (keycode 189) in the datefield, see the log of the sample. KeyCode 173 is returned

The result that was expected:
Keycode 189 should be returned

The result that occurs instead:
Keycode 173 is returned, and I do not know anything about keycode 173

Test Case:



Ext.onReady(function() {

var datefield = new Ext.form.field.Date({

renderTo: Ext.getBody(),
enableKeyEvents: true,
listeners: {

keydown: {

fn: function(obj, event) {

console.log('keycode ' + event.getKey());

}

}

}

});

});

slemmon
15 Apr 2013, 8:54 AM
I believe this is a browser distinction rather than a bug in the ExtJS framework.
See:
https://bugzilla.mozilla.org/show_bug.cgi?id=787504

and for reference:
http://www.asquare.net/javascript/tests/KeyCode.html

tvanzoelen
15 Apr 2013, 11:10 PM
Its an old bug then.... maybe the event wrapper can be modified and change it into a 189 code.

Would be more consistent

tvanzoelen
15 Apr 2013, 11:32 PM
hmm interesting http://www.asquare.net/javascript/tests/KeyCode.html

gives a 173 on mac and a 189 on windows.