Closed Bug 372015 Opened 13 years ago Closed 13 years ago

No KeyPress event fires for Up/Down Arrow and Page Up/Down keys

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

1.8 Branch
x86
All
defect
Not set

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: bugs-a17, Assigned: mano)

References

(Blocks 1 open bug)

Details

(Keywords: regression, testcase, verified1.8.1.4)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20070220 Firefox/2.0.0.2
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20070220 Firefox/2.0.0.2

In FireFox 2.0.0.2, the four keys: Up Arrow, Down Arrow, Page Up and Page Down will generate KeyDown events but not KeyPress events.  All other keys work normally.

This has been tested on both the Linux and Windows builds.  This bug was not present in FF 2.0.0.1 or previous versions.

Reproducible: Always

Steps to Reproduce:
1. Create a little test script that contains an <INPUT type="text"> element and handlers for KeyDown and KeyPress that tell you when they fire (e.g., see below).
2. Focus the input field and press various keys; note that for each key pressed, both events fire.
3.  Now press UpArrow, DownArrow, PageUp or PageDown.
Actual Results:  
Only the onKeyDown event fires for UpArrow, DownArrow, PageUp and PageDown.

Expected Results:  
The onKeyPress event should fire for these four keys.

Here's a silly little test page as described above:

<html><head><script type="text/javascript">
press = down = 0;
</script></head>
<body>
<input type="text" name="test"
 onkeypress="document.getElementById('press').innerHTML='KeyPress events = '+(++press);"
 onkeydown="document.getElementById('down').innerHTML='KeyDown events = '+(++down);" >
<p id="press"></p>
<p id="down"></p>
</body></html>
Assignee: nobody → events
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → 1.8 Branch
Huh, what could have caused this regression.
Reporter, could you upload the testcase using "Add an attachment".
Ok, I think this is related to autocomplete.
When autocomplete="off", keypress is dispatched.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OK, per request of Smaug, a slightly more elegant test script is attached which accomplishes the same task as the silly example inlined above.

Focus the input field and then type.  Up/Down arrows won't update the KeyPress listing.
Maybe bug 286933? 
Flags: blocking1.8.1.4?
Assignee: events → mano
Flags: blocking1.8.1.4? → blocking1.8.1.4+
Keywords: regression
Blocks: 286933
fixed by backing it out.
Status: NEW → RESOLVED
Closed: 13 years ago
Keywords: fixed1.8.1.4
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8.1
Verified fixed 1.8.1.4 using testcase from comment #3 with 

Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.4pre) Gecko/2007042403 BonEcho/2.0.0.4pre

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4pre) Gecko/2007042603 BonEcho/2.0.0.4pre on Fedora FC6 

and Verified Fixed on Trunk on Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4pre) Gecko/2007042603 BonEcho/2.0.0.4pre Windows Vista

The Testcase shows the expected results, the KeyPress event fires -> adding verified flags
Status: RESOLVED → VERIFIED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.