Closed
Bug 333475
Opened 20 years ago
Closed 19 years ago
onkeydown preventDefault doesn't cancel keypress on Mac
Categories
(Core Graveyard :: Widget: Mac, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8.1
People
(Reporter: mark, Assigned: mark)
Details
(Keywords: testcase)
Attachments
(1 file)
|
1.33 KB,
text/html
|
Details |
On the Mac, an onkeydown event handler that calls event.preventDefault() does not suppress the keystroke from being handled in some situations. In the testcase, a <div> with style display:none is shown in response to a keydown event, and an <input> contained therein is focused. The event then has preventDefault called on it.
On Linux and Windows, the key pressed does not register any input in the now-focused <input> field.
On Mac, the key pressed causes a keypress to appear in the text field, even though the keydown handler called preventDefault.
I think we may have an open bug on this, but I can't find it.
| Assignee | ||
Comment 1•20 years ago
|
||
Open the testcase and press the 'z' key to unhide a <div> and focus an <input type="text"> that it contains.
Expected results: the 'z' is not added to the text field because preventDefault was called.
Observed results (on Mac): the 'z' is added to the text field.
The workaround clears the text field on a zero-duration timer after displaying the <div>.
Comment 2•20 years ago
|
||
This problem was mentioned in bug 333475.
| Assignee | ||
Comment 3•20 years ago
|
||
Of course it was! Did you have another bug in mind?
Comment 4•20 years ago
|
||
Oops. This problem was mentioned in bug 332561.
| Assignee | ||
Updated•19 years ago
|
Assignee: events → mark
| Assignee | ||
Comment 5•19 years ago
|
||
I fixed this in bug 337199 after I rewrote the key event handlers.
Status: NEW → RESOLVED
Closed: 19 years ago
Component: DOM: Events → Widget: Mac
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•