Closed Bug 106789 Opened 24 years ago Closed 23 years ago

JS should not fire keypress event while dead-key is pressed

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: chado_moz, Assigned: joki)

Details

maybe Keyboard Navigation issue. While eventListener is activated against keypress, when any keyboard shortcut is used, appropriate action is done. But shortcut key also triggar the keypress event unexpectedly. In other words, single user's action causes dual browser's actions. NC4.x works fine. reproducing process: 1. open http://www2.wbs.ne.jp/%7Echado/work/js_keypress/js_keypress.html (testcase) by mozilla. 2. click "enable keypress" button. 3. press any key some time, and see the code of pressed key displayed in the textarea. 4. use any keyboad shortcut. (for example, cmd/ctrl-n for "new navigator window".) see appropriate action is done (new navigator window is opened). 5. back to the testcase window. expected result: keypress event is not fired. code of key pressed with cmd/ctrl ("n") is not displayed in the textarea. actual result: keypress event is fired. code of key pressed with cmd/ctrl ("n") is displayed in the textarea. reproducible; always. build: any build. I have confirmed on: mac milestone 0.9, 0.9.3, 0.9.5, 2001-10-24-08-trunk. win milestone 0.9, 0.9.3, 0.9.4, 0.9.5, 2001-10-24-09-trunk. Any other keyboad shortcut, b for "Manage Bookmarks", t for "New Tab", or something can also reproduce this.
Reporter: Why is this a bug? I don't see anything wrong in a ctrl+key press firing a keyPress event. I don't see why this would be "unexpected"; I expect the browser to detect a ctrl+key press. A simple test is using CTRL+A.
The point is : single action should not causes dual (separate) reactions. In the case of CTRL+A: The mission of CTRL+A is completed in "Select All". So, should not be caught as another keypress event.
Reporter: I'm still not convinced. Bug 11956 indicates very strongly this is considered correct behavior. Also see bug 1572. What's actually happening is this: (1) User presses CTRL+A. (2) Event listener on window object captures the keyPress event and modifies the textarea. (3) The event proceeds through the listener. (4) The browser receives the CTRL+A key press combination and selects the text. You can see this by executing the following line immediately after Step 2 of your testcase: javascript:window.addEventListener('keypress', function() {alert("Captured")}, true); As far as I can tell, this is a correct sequence of actions.
I couldn't understand about bug 11956 and bug 1572. (It is hard for me. I'm not a English-speaker.) But Alex told me important thing. > this is a correct sequence of actions. Not a current sequence ? OK. I understand. That is Mozilla's way. Thanks.
Invalid
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
QA Contact: madhur → rakeshmishra
QA Contact: rakeshmishra → trix
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.