#4556 closed bug (duplicate)
keypress + escape + event key code + Firefox
Reported by: | nanodeath | Owned by: | brandon |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | event | Version: | 1.3.2 |
Keywords: | esc keypress which | Cc: | |
Blocked by: | Blocking: |
Description
I want to capture when the user hits "Esc" on a input text field on keypress, but this event gets propagated with the "which" value 0 on Firefox (0 is the charCode, 27 is the keyCode). keyup and keydown have their values propagated correctly.
Expected: pressing Esc should propagate 27 as value for event.which. Actual: pressing Esc propagates 0 as value (in Firefox 3).
Note: this behavior is also present in jQuery 1.2.6.
Change History (5)
comment:1 Changed 14 years ago by
comment:3 Changed 12 years ago by
This jsfiddle can be used to test what happens with keycodes. http://jsfiddle.net/boushley/YxunV/1/
Interestingly, IE 8 (didn't get a chance to test 6 or 7) properly show code 27, Firefox shows code 0, and Chrome/Safari don't register a keypress event for pressing escape.
comment:4 Changed 12 years ago by
Keywords: | esc keypress which added |
---|---|
Milestone: | 1.4 → 1.5 |
Priority: | minor → low |
Status: | new → open |
Hmm, I wonder if there's a way to normalize this given that webkit doesn't seem to send anything at all. Appreciate the test case boushley. :)
comment:5 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
This appears to be a duplicate of #3311