Closed
Bug 941764
Opened 12 years ago
Closed 10 years ago
onkeypress suddenly doesn't work in a class that has worked for 4 years
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: kentozier, Unassigned)
Details
(Keywords: regressionwindow-wanted)
Attachments
(1 file)
|
3.20 KB,
application/x-javascript
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1
Steps to reproduce:
Added console.log in event handler to report key events and then type any character key
Actual results:
keyDown and keyUp events are logged, but keyPress never gets called
Expected results:
document.onkeypress should call my handler.
I wrote this class about 4 years ago and it has worked perfectly for years, up until about Nov 10, 2013. Only thing I can think of is that one of the automatic FF upgrades changed the default key event target from "body" to something that doesn't always respond.
Comment 1•12 years ago
|
||
What keys are you trying? Probably things like "Enter", which stopped working in FF 29. If that's the case you're code is just wrong. You cannot expect the onkeypress event for any key. I just had the same problem with some legacy code. The author probably intended to catch onkeydown instead.
Unfortunately I could not find the exact change in FF 29 for reference. Can anybody point me to it?
Comment 2•12 years ago
|
||
Found some reference. Seems to not have happened on purpose on is going to be reverted: https://bugzilla.mozilla.org/show_bug.cgi?id=1008244
Updated•12 years ago
|
Keywords: regressionwindow-wanted
Comment 3•12 years ago
|
||
What does the CancelEvent() do? If it calls .preventDefault(), it must be the cause. Now, a call of preventDefault() of keydown event cancels following keypress event(s). This change is for conforming DOM Level 3 Events. By this change, Gecko's behavior is more similar to other browsers.
keypress event is now deprecated event in D3E spec. However, it is defined as one of default actions of keydown event. And a call of preventDefault() should cause canceling its default action.
https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-keydown
http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-Event-preventDefault
Flags: needinfo?(kentozier)
Comment 4•11 years ago
|
||
I've sent a note to Ken to follow-up on the pending needinfo request.
Comment 5•10 years ago
|
||
Masayuki-san, is this bug actionable as-is or should we close it out as incomplete due to lack of a testcase?
Flags: needinfo?(masayuki)
Comment 6•10 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #5)
> Masayuki-san, is this bug actionable as-is or should we close it out as
> incomplete due to lack of a testcase?
I guess that the cause of calling preventDefault() of keydown via CancelEvent() in the attached js file. If so, the testcase is invalid.
I think that we should mark this as INCOMPLETE and if we're wrong, just reopen this bug.
Flags: needinfo?(masayuki)
Comment 7•10 years ago
|
||
Thanks for the reply.
Ken, if you happen to come back to this bug and find that there's still an issue, feel free to reopen it. Preferably including a reduced testcase that reliably demonstrates the issue.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(kentozier)
Resolution: --- → INCOMPLETE
| Assignee | ||
Updated•7 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•