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: | Owned by: | ||
---|---|---|---|
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.
Change History (8)
comment:1 Changed 10 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:2 Changed 10 years ago by
Status: | pending → new |
---|
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
Component: | unfiled → event |
---|---|
Status: | new → pending |
comment:4 Changed 10 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
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
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
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:7 Changed 10 years ago by
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
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
Duplicate of #10172.
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.