Closed Bug 423512 Opened 17 years ago Closed 17 years ago

contenteditable divs don't fire events

Categories

(Core :: DOM: Editor, defect)

x86
Windows Vista
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: rpaplin, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b4) Gecko/2008030714 Firefox/3.0b4 Build Identifier: Firefox/3.0b4 The page listed above has a DIV with a contenteditable = true attribute. The DIV contains several spans with a contenteditable = false attribute. Event handlers are registered on the DIV via markup like so... <DIV id="divTo" onkeypress="onevent(this);" oncut="onevent(this);" onpaste="onevent(this);" onkeydown="onevent(this);" onclick="onevent(this)" oncopy="onevent(this);" onkeyup="onevent(this);" onresize="onevent(this)" contentEditable="true"> The example page has code, so when the event fires, a checkbox should get checked. Reproducible: Always Steps to Reproduce: 1. Set the caret to an editable area in the To... address field in the attached web page to fire the onclick event 2. Press keys on the keyboard to fire the onkeypress, onkeydown, and onkeyup events 3. Start selecting text and right clicking the clipboard options (or press Ctrl+X, Ctrl+C, Ctrl+V) to fire the oncut, oncopy, and onpaste events Actual Results: On Firefox 3.0 none of the registered events fire Expected Results: All of the events fire
If you open the Error Console you'll see errors ("event is not defined"). In Firefox you need to pass the event object to your 'onevent' function. See http://developer.mozilla.org/en/docs/DOM:event#DOM_event_handler_List for examples. Given this, it's an error in the test (an invalid testcase), and not Firefox.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: