Skip to main content

Bug Tracker

Side navigation

#5408 closed bug (duplicate)

Opened October 25, 2009 10:21PM UTC

Closed September 28, 2010 10:02PM UTC

Last modified March 10, 2012 09:29AM UTC

event.fix() for keypress() broke detection of Up/Down/etc. keys

Reported by: powerman Owned by: brandon
Priority: major Milestone: 1.4.3
Component: event Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

The event.fix() function (line 2746 in jquery-1.3.2) change value of event.which, and thus broke detection of MANY keys.

For example, on keypress() in Opera-10,

key Up return: keyCode=38, charCode=undefined, which=0

key & (Shift+7) return: keyCode=38, charCode=undefined, which=38

So, only way to distinguish Up and & is check event.which value... but jquery's event.fix() make event.which=event.keyCode.

As workaround one may use instead of

$("#input").keypress(myfunc);

this code:

$("#input").each(function(){
  this.onkeypress=myfunc;
});
Attachments (0)
Change History (2)

Changed April 01, 2010 02:34AM UTC by powerman comment:1

Ticket #2338 is probably same bug.

Changed September 28, 2010 10:02PM UTC by john comment:2

milestone: 1.41.4.3
resolution: → duplicate
status: newclosed
version: 1.3.21.4.2

Yeah, this seems to be the same as #2338, which was just fixed.