W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2006

[whatwg] oninput event

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 15 Aug 2006 00:20:03 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0608150011250.5340@dhalsim.dreamhost.com>
On Mon, 13 Feb 2006, Christian Schmidt wrote:
> Quote from the current working draft (10 January 2006)
> <http://whatwg.org/specs/web-forms/current-work/#the-change>:
> > UAs may delay firing the input event if the data entry is rapid.
> > Authors must not rely on this event firing once for each key press,
> > mouse input, or similar.
> I assume "key press, mouse input, or similar" refers to whenever the 
> control's value attribute changes, i.e. not key presses on arrow keys 
> etc.


> UAs may delay firing the event, but are they allowed skip it?

The spec was unclear on this. I've tried to fix it.

> If UAs are NOT allowed to skip events, what is the purpose of delaying them?
> And what exactly does delaying mean (e.g. what is the value of the control's
> value attribute when the event eventually occurs)?

The idea is that if a user types "hello" very quickly, you'll only fire an 
event at the end of the "o", rather than five times in one millisecond, 
but if he types "hell" then waits then types "o", you'll fire two events, 
one after the second "l" and one after the "o". This allows authors to 
easily implement incremental search UI.

> If UAs ARE allowed to skip events, I think it is a reasonable 
> requirement that the last event per control in a series of inputs is not 
> skipped, so that e.g. oninput="output.value=value" will always make the 
> output control be in sync shortly after the last key press (but not 
> necessarily while the user is typing rapidly).


Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 14 August 2006 17:20:03 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:48 UTC