Closed Bug 122212 Opened 23 years ago Closed 23 years ago

when capturing keypressevent code can't cancel keys pressed in input type="text" and textarea elements

Categories

(Core :: DOM: Events, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 54035

People

(Reporter: martin.honnen, Assigned: joki)

Details

Attachments

(1 file)

I am trying to capture the keypress event and then depending on the key I want to cancel the event. However, despite calling both event.preventDefault() and event.stopPropagation() the keypress is not cancelled when occuring inside a textarea or an input type="text" element. As I in the example try to cancel the return key I also included a link and a button in the test case and there the cancellation of the return key works as the button/link can't be activated by focussing on them and pressing return. So we are faced with keypress event targetted at textarea elements and text input elements not being cancellable. NN4 has no problems to capture the keypress and cancel it in the textarea/text input. And with IE6's event bubbling system it is also possible to cancel the key when intended.
*** This bug has been marked as a duplicate of 54035 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
verifying
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: