Closed Bug 467513 Opened 16 years ago Closed 14 years ago

Some keypress events don't bubble out of input fields

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: fabian.jakobs, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

I usually catch all key events on the document body but it in input fields (type=text) some keypress events don't bubble. I observed this with the Up, Down, PageUp and PageDown events. Maybe there are some more keys. Pressing e.g. down in an input field fires keypress on the field but not on the document.body. Keydown and keyup events are fired and bubble as expected. I have verified this problem in Firefox 2 and 3 on OSX.
Attached file Test case (obsolete) —
If you focus the input field and press the Up arrow key, no keypress is dispatched on the document body. Pressing the Left arrow key however fires a keypress on the body.
Attached file Test case
If you focus the input field and press the Up arrow key, no keypress is dispatched on the document body. Pressing the Left arrow key however fires a keypress on the body.
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → events
Version: 3.0 Branch → 1.9.0 Branch
Can you check if this bug is still present in a 3.1 nightly? http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ I can reproduce it in 3.0.4 but not in a recent 3.1 nightly.
I can still reproduce it with the latest trunk. Tested on OSX 10.5.
Oh, now I can, too. It looks like the bug only occurs when the cursor is at the start (up) / end (down) of the textfield. Bug 231754 might have to do something with this (just guessing).
Severity: major → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: All → Mac OS X
Hardware: Macintosh → All
Version: 1.9.0 Branch → Trunk
Attachment #350945 - Attachment is obsolete: true
Seems like that bug may very well have caused this.
Or, not caused, but made this worse.
I think really we want the various ui behaviour to be the default handling for the event rather than just a listener. Then we don't need to call stopPropagation at all. But that's not possible currently until xbl2.
It is possible (at least in C++ and XBL) if we register listeners to system event group.
And also if chrome JS adds event listeners for bubble phase to somewhere in chrome, those are called after content listeners - so they are in practice default handlers.
This problem also happens on Windows and Linux, so -> All. For that matter it also happens in FF2.
OS: Mac OS X → All
This seems to work with 3.6.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: