Some keypress events don't bubble out of input fields

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
10 years ago
8 years ago

People

(Reporter: fabian.jakobs, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

1.13 KB, text/html
Details
(Reporter)

Description

10 years ago
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.
(Reporter)

Comment 1

10 years ago
Created attachment 350945 [details]
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.
(Reporter)

Comment 2

10 years ago
Created attachment 350946 [details]
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.
(Reporter)

Comment 4

10 years ago
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

Comment 6

10 years ago
Seems like that bug may very well have caused this.

Comment 7

10 years ago
Or, not caused, but made this worse.

Comment 8

10 years ago
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.

Comment 9

10 years ago
It is possible (at least in C++ and XBL) if we register listeners to system event group.

Comment 10

10 years ago
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
Last Resolved: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.