Bug Tracker

Ticket #4556 (closed bug: duplicate)

Opened 6 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 5 years ago by rmaclean

This appears to be a duplicate of #3311

comment:3 Changed 4 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 4 years ago by SlexAxton

  • Keywords esc keypress which added
  • Priority changed from minor to low
  • Status changed from new to open
  • Milestone changed from 1.4 to 1.5

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

  • Status changed from open to closed
  • Resolution set to duplicate

comment:6 Changed 4 years ago by dmethvin

Duplicate of #7183.

Note: See TracTickets for help on using tickets.