Bug Tracker

Opened 10 years ago

Closed 10 years ago

#12469 closed bug (duplicate)

jQuery don't fix Google Chrome bug where keypress is not fired for all keydown and keyup events

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: None
Component: event Version: 1.8.0
Keywords: Cc: dmethvin
Blocked by: Blocking:


Google Chrome have bug, that keypress event is not fired (I think for all events where charCode == 0)

data:text/html,<input onkeypress="console.log(event)"/>

backspace and keypad keys don't fire keypress event

the fix I used in my code look like this

$('input').keyup(function(e) {

if (!e.charCode) {

$(this).trigger('keypress', e);


}).keypress(function(e) {



(there is no webkit detect).

If jQuery aim to fix browser differences, it should fix this kind of differnces as well, and execute jQuery keypress even if browser onKeypress event is not fired.

Change History (8)

comment:1 Changed 10 years ago by timmywil

Owner: set to [email protected]
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery git("edge") version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/. Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 10 years ago by [email protected]

Status: pendingnew

Here is jsFiddle http://jsfiddle.net/Byspn/1/ (tested on Chromium 18.0.1025.168 Ubuntu 11.10) in Opera and Firefox keypress event is fired.

comment:3 Changed 10 years ago by mikesherov

Component: unfiledevent
Status: newpending

I tested this on latest chrome, latest firefox, and latest Opera. I also tested on Chrome 18. Here is a screenshot of my results indicating that it works fine: http://gyazo.com/a0d82b57f253d72899cdff597ce216e5.png Perhaps there is an issue specifically with Chromium? Can you provide a screenshot of the issue?

Last edited 10 years ago by mikesherov (previous) (diff)

comment:4 Changed 10 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:5 Changed 10 years ago by [email protected]

You need to type backspace for example, I think it's for key that will get charCode == 0 in keypress, sorry I dind't mention that you should try backspace.

chrome: http://imgur.com/Ee7j6 firefix: http://imgur.com/KueXs

on firefix there is 6 events on chrome 5, for backspace there is only keydown and keyup with keypress missing.

PS: I didn't get email notification about comment from mikesherov. I got notification about comment from timmywil and then about ticket close. Maybe you have bug in notification system.

comment:6 Changed 10 years ago by mikesherov

Resolution: invalid
Status: closedreopened

comment:7 Changed 10 years ago by mikesherov

Cc: dmethvin added

I can repro it now, thanks for following up. Not sure if there is anything we can do about that, but I'll see what dmethvin has to say.

comment:8 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: reopenedclosed

Duplicate of #10172.

Note: See TracTickets for help on using tickets.