Text not entered in form when preventDefault is called




12 years ago
8 years ago


(Reporter: Mark Boudreau, Unassigned)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: [CLOSEME 2010-11-01], URL)


(1 attachment)



12 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

I noticed this when attempting to capture keypresses inside of a dynamically generated iframe.  After giving the iframe a "load" listener, and using the load listener to put a "keydown" listener on the iframe, I was not able to enter text into a form field when preventDefault() was called.

Reproducible: Always

Steps to Reproduce:
1. Create iFrame dynamically (body onload="createIframe()")
2. Add a load listener to that iFrame
3. In the load listener, add a keydown listener
4. Call preventDefault() in the keydown listener
5. Try to type in a form field

Actual Results:  
Nothing happens, see http://lyon.ftrd.us:8080/test/test.html or the attached testcase

Expected Results:  
You would be able to type in the box but other things such as spatial navigation (on the mobile) or other shortcut keys would be disabled

Comment 1

12 years ago
Created attachment 246955 [details]
testcase containing all HTML and JS files

This is the testcase for the bug (if navigating to http://lyon.ftrd.us:8080/test/test.html doesn't work)
This is a mass search for bugs that are in the Firefox General component, are UNCO, and have not been changed for 1000 days and have an unspecified version. 

Reporter, can you please update to Firefox 3.6.10, create a fresh profile, http://support.mozilla.com/en-US/kb/managing+profiles, and test again. If you still see the bug, please update this bug. If the issue is gone, please set the resolution to RESOLVED > WORKSFORME.
Whiteboard: [CLOSEME 2010-11-01]

Comment 3

8 years ago
It's unclear whether or not this was a valid bug in the first place.

It seems that preventDefault() blocking text input is the intended behavior.  I was seeing weird issues when adding a javascript alert() to the click handler, but that is no longer happening.

Testing on other browsers leads to a problem with Javascript access across frames (even though they are local) so I cannot compare behavior.

Because I no longer see weird issues which prompted me to report this, I'm going to resolve this bug then.
Last Resolved: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.