Bug Tracker

Modify

Ticket #12469 (closed bug: duplicate)

Opened 20 months ago

Last modified 19 months ago

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

Reported by: jcubic@… Owned by: jcubic@…
Priority: undecided Milestone: None
Component: event Version: 1.8.0
Keywords: Cc: dmethvin
Blocking: Blocked by:

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

comment:1 Changed 20 months ago by timmywil

  • Owner set to jcubic@…
  • Status changed from new to pending

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 20 months ago by jcubic@…

  • Status changed from pending to 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 20 months ago by mikesherov

  • Status changed from new to pending
  • Component changed from unfiled to event

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?1347118417 Perhaps there is an issue specifically with Chromium? Can you provide a screenshot of the issue?

Last edited 20 months ago by mikesherov (previous) (diff)

comment:4 Changed 19 months ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

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 19 months ago by jcubic@…

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 19 months ago by mikesherov

  • Status changed from closed to reopened
  • Resolution invalid deleted

comment:7 Changed 19 months 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 19 months ago by dmethvin

  • Status changed from reopened to closed
  • Resolution set to duplicate

Duplicate of #10172.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.