Skip to main content

Bug Tracker

Side navigation

#7300 closed bug (wontfix)

Opened October 25, 2010 12:29AM UTC

Closed October 25, 2010 06:01PM UTC

Last modified March 13, 2012 11:40PM UTC

Keypress not getting arrow keys in chrome

Reported by: matthew@matthewfl.com Owned by:
Priority: high Milestone: 1.5
Component: event Version: 1.4.3
Keywords: keypress arrow-keys chrome Cc: john
Blocked by: Blocking:
Description

The keypress event is triggered by the arrow keys in Firefox, but not in chrome.

OS: Mac 10.5.8

Browser: Chrome 7.0.517.41

The problem can be seen on the example page (http://api.jquery.com/keydown/) in chrome when compared to Firefox

I would expect that the arrow key would trigger the event as that is what happens in Safari.

Attachments (0)
Change History (5)

Changed October 25, 2010 01:01AM UTC by addyosmani comment:1

keywords: → keypress arrow-keys chrome needsreview
priority: undecidedhigh
status: newopen

I have just tested the keydown API page in FireFox, Chrome and Safari (all on the latest stable builds) and the arrow keys are being captured correctly/fine in all of these browsers - I believe you meant to refer to the /keypress page instead.

Testing keypress, I see that there is definitely some issue with Chrome correctly capturing the right, left, up and down keys, but not an issue with it doing so using any other key (as far as I can tell). To ensure this isn't an issue with our API page i setup a test here http://jsfiddle.net/addyosmani/nmNjV/. I have also verified this issue offline and it appears to be consistently failing with arrow keys and keypress.

Marking as valid and flagging for further review.

Changed October 25, 2010 01:13AM UTC by addyosmani comment:2

_comment0: dmethvin has also confirmed this issue. I'll also add that I'm experiencing it in Safari 5.02 so it may be a generic Webkit issue. We've tested capturing keypress without jQuery in those browsers and are experiencing issues there too so a (slightly) larger workaround of some sort may be needed. [[BR]] \ \ Just for further confirmation: this is broken with 1.4.3, 1.4.2 and 1.3.2 as well (all testing has been done on OSX so far for what it's worth). \ \ 1287970168191946
cc: → john
component: unfiledevent

dmethvin has also confirmed this issue. I'll also add that I'm experiencing it in Safari 5.02 so it may be a generic Webkit problem. We've tested capturing keypress without jQuery in those browsers and are experiencing issues there too so a (slightly) larger workaround of some sort may be needed.

Just for further confirmation: this is broken with 1.4.3, 1.4.2 and 1.3.2 as well (all testing has been done on OSX so far for what it's worth).

Changed October 25, 2010 06:01PM UTC by addyosmani comment:3

resolution: → wontfix
status: openclosed

I've reviewed the bulk of tickets regarding keypress on both the Chrome, Chromium and Webkit bug trackers and it would appear that there are no intentions on supporting correct keypress behavior from any of these camps now or in the future. The reason for this is that a) keypress and its behavior is not mentioned specifically in any specs and b) Although FireFox and Opera support this feature, Webkit (used by Chrome and Safari) decided to copy the IE behavior in this case which reserves arrow keypresses for internal browser behavior only. There is no way that jQuery can circumvent this behavior and it is instead recommended that you use keydown instead as this is supported.

Changed November 02, 2010 02:15AM UTC by dmethvin comment:4

keywords: keypress arrow-keys chrome needsreviewkeypress arrow-keys chrome

Changed August 02, 2011 12:30PM UTC by abonae@gmail.com comment:5

Replying to [comment:4 dmethvin]:

This is a real pain as the Backspace key is not recognised either.