[Webkit-unassigned] [Bug 15189] New: should support oninput event
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Sep 12 08:44:19 PDT 2007
http://bugs.webkit.org/show_bug.cgi?id=15189
Summary: should support oninput event
Product: WebKit
Version: 522+ (nightly)
Platform: PC
OS/Version: Windows XP
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: Forms
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: shadow2531 at gmail.com
CC: ap at webkit.org
Every element that supports onchange should support the input event.
The input event should be fired whenever the value of the control is *changed*
to a *different* value by *any* *user-initiated* action.
User-initiated actions would be for example: cut, paste, delete, clear, undo,
redo, drag-n-drop (as-in anything you can drag and drop into a textarea) or any
other user action that changes the value with the keyboard or mouse or whatever
input device the user is using.
You should be able to use the input event with
element.addEventListener("input", function, false), element.oninput = function
and the oninput attribute.
See "4.2. The change and input events" at <
http://www.whatwg.org/specs/web-forms/current-work/#the-click > for more info.
Opera and Firefox have partially supported it for a while and IE supports
onpropertychange (which works kind of like input). This means that other
browsers have a way to use one event to listen for all user-initiated changes.
Notes:
[Firefox bugs]
https://bugzilla.mozilla.org/buglist.cgi?quicksearch=oninput
[Opera 9.5a bugs]
Fires the event twice for each change. Firefox doesn't. This has been filed for
Opera.
Fires the event even when the value doesn't change (like hitting the del key in
an empty textarea). This has been filed also.
Dragging and dropping doesn't work for all things yet and sometimes you have to
click outside the textarea (like onchange) to get the event to fire. Also
filed.
Even with those quirks, having oninput is essential and very useful today (at
least with textareas) and will be in HTML5 once the form stuff is merged in.
Hixie's live DOM viewer makes use of it for a textarea. <
http://software.hixie.ch/utilities/js/live-dom-viewer/ >.
My JS URI creator makes use of it for a textarea. <
http://shadow2531.com/js/jsuri.html >. I make a crappy workaround for Safari by
turning on paste, change, keydown, keyup, keypress and textInput events, but
it's not the same. See < http://shadow2531.com/js/jsuri.js >.
Although oninput should work for any control that supports onchange, textareas
are the most important here so authors don't have to use workarounds for
webkit.
You can test some very basic demos at <
http://shadow2531.com/opera/testcases/oninput/ > in Firefox and Opera.
--
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list