WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
20208
contenteditable items don't send notifications when they're edited
https://bugs.webkit.org/show_bug.cgi?id=20208
Summary
contenteditable items don't send notifications when they're edited
Bernhard Rosenkraenzer
Reported
2008-07-29 02:56:09 PDT
Currently, there doesn't seem to be a way of reacting when a contenteditable item changes. Something akin to the onchange="" bits in normal html input fields would be nice. (e.g. <p contenteditable="true" onchange="validateinput()">Please modify this text</p>)
Attachments
demonstration of the textInput event not firing.
(355 bytes, text/html)
2010-07-13 17:55 PDT
,
David Gatwood
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
mitz
Comment 1
2008-07-29 10:28:48 PDT
You can listen for DOM mutation events on the element. For example, editing text nodes will result in DOMCharacterDataModified events.
David Gatwood
Comment 2
2009-11-27 20:54:18 PST
I was about to file a bug about this problem myself. The only case I care about is detecting when the user deletes a non-contentEditable node within a contentEditable container. Neither the non-editable node itself nor the editable parent gets any sort of mutation event when this happens.
Julie Parent
Comment 3
2010-02-11 15:25:07 PST
Would oninput events meet your needs? See
https://bugs.webkit.org/show_bug.cgi?id=26526
for more details.
Ojan Vafai
Comment 4
2010-07-13 08:31:26 PDT
Looks like the input event meets this use case. Feel free to reopen if it does not.
David Gatwood
Comment 5
2010-07-13 17:55:15 PDT
Created
attachment 61443
[details]
demonstration of the textInput event not firing.
David Gatwood
Comment 6
2010-07-13 17:56:02 PDT
I finally got around to testing it. The textInput event completely fails to meet the needs. 1. It requires writing JavaScript to go wading through the HTML and adding handlers everywhere (unlike onChange, which can be written as an attribute in the tag). 2. Deleting stuff in contentEditable blocks doesn't fire these events, at least in Safari 5. I've attached a really trivial test case. Click anywhere and hit the backspace key. You can delete entire lines of content without a single textInput event firing.
Ojan Vafai
Comment 7
2010-07-13 18:08:41 PDT
It's the "input" event that you want. It will only work in a nightly build since it was just checked in recently.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug