Closed Bug 984380 Opened 10 years ago Closed 9 years ago

Keypress fires incorrectly for some AltGr+char combinations

Categories

(Core :: DOM: Events, defect)

27 Branch
x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 968056

People

(Reporter: isaacsalier, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release)
Build ID: 20140212131424

Steps to reproduce:

Testing in Windows 8.1, Firefox 27.0.1.

1. Open http://jsfiddle.net/salier/2zN9L/.
2. Switch to Polish keyboard.
3. Type characters into input, verify appropriate keydown/keypress/input/keyup combinations.
4. Type `AltGr+d` into the input. This combination does not produce a character with the Polish keyboard.


Actual results:

A `keypress` event fires with a `which` value of 100 (character "d"). No character is inserted into the text input, and no `input` event occurs.


Expected results:

No `keypress` event should fire for this combination. Keydown and keyup events should fire for the modifiers and the `D` key, but with no corresponding character output, no keypress should occur.
To clarify, keydown and keyup events fire as expected.
Component: Untriaged → DOM: Events
Product: Firefox → Core
It's by design at least for now. Gecko dispatches keypress events even if the key doesn't insert text.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
FYI: If you need to distinguish if a keypress event will cause text input, check ctrlKey and altKey. Both of them are false when it will insert text.
You need to log in before you can comment on or make changes to this bug.