Skip to main content

Bug Tracker

Side navigation

#12469 closed bug (duplicate)

Opened September 05, 2012 04:11PM UTC

Closed September 24, 2012 02:26PM UTC

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

Reported by: jcubic@onet.pl Owned by: jcubic@onet.pl
Priority: undecided Milestone: None
Component: event Version: 1.8.0
Keywords: Cc: dmethvin
Blocked by: Blocking:
Description

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) {

console.log(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.

Attachments (0)
Change History (8)

Changed September 06, 2012 02:04PM UTC by timmywil comment:1

owner: → jcubic@onet.pl
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.

Changed September 06, 2012 04:51PM UTC by jcubic@onet.pl comment:2

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.

Changed September 08, 2012 03:51PM UTC by mikesherov comment:3

_comment0: 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: \ [[Image(http://gyazo.com/a0d82b57f253d72899cdff597ce216e5)]] \ \ Perhaps there is an issue specifically with Chromium? Can you provide a screenshot of the issue?1347119594504358
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:

[[Image(http://gyazo.com/a0d82b57f253d72899cdff597ce216e5.png?1347118417)]]

Perhaps there is an issue specifically with Chromium? Can you provide a screenshot of the issue?

Changed September 23, 2012 08:59AM UTC by trac-o-bot comment:4

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!

Changed September 23, 2012 09:49AM UTC by jcubic@onet.pl comment:5

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.

Changed September 23, 2012 02:01PM UTC by mikesherov comment:6

resolution: invalid
status: closedreopened

Changed September 23, 2012 02:14PM UTC by mikesherov comment:7

cc: → dmethvin

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.

Changed September 24, 2012 02:26PM UTC by dmethvin comment:8

resolution: → duplicate
status: reopenedclosed

Duplicate of #10172.