Bug Tracker

Opened 9 years ago

Closed 7 years ago

Last modified 6 years ago

#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 9 years ago by rmaclean

This appears to be a duplicate of #3311

comment:3 Changed 7 years ago by boushley

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 7 years ago by SlexAxton

Keywords: esc keypress which added
Milestone: 1.41.5
Priority: minorlow
Status: newopen

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 7 years ago by dmethvin

Resolution: duplicate
Status: openclosed

comment:6 Changed 7 years ago by dmethvin

Duplicate of #7183.

Note: See TracTickets for help on using tickets.