This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23449 - <input>: Fire an 'input' event before the 'change' event for type=radio, type=checkbox, and type=file
Summary: <input>: Fire an 'input' event before the 'change' event for type=radio, type...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P2 enhancement
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-07 17:15 UTC by contributor
Modified: 2013-12-19 00:10 UTC (History)
18 users (show)

See Also:


Attachments

Description contributor 2013-10-07 17:15:55 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html
Multipage: http://www.whatwg.org/C#radio-button-state-(type=radio)
Complete: http://www.whatwg.org/c#radio-button-state-(type=radio)
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html

Comment:
On change, it fires a "change"event. Why not also an "oninput" event? (just
like text-like input types)

Posted from: 186.244.78.149
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36
Comment 1 Ian 'Hixie' Hickson 2013-10-07 21:41:00 UTC
Hm, interesting, we indeed do not. I thought we did. I wonder why.

Can anyone see a reason not to fire 'input' events on <input type=radio> elements?
Comment 2 Boris Zbarsky 2013-10-08 15:34:30 UTC
Adding the Gecko person who knows events.  ;)
Comment 3 Ian 'Hixie' Hickson 2013-10-22 22:38:40 UTC
Also type=checkbox and type=file.

I propose firing the 'input' event immediately before firing the 'change' event, in all three cases. If anyone can think why we shouldn't do that, please do let me know. I can't find any trace of why we don't already (still looking though).
Comment 4 Ian 'Hixie' Hickson 2013-10-23 20:09:02 UTC
Looks like this has been this way since r2282 when change and input events were first specced. I don't understand why; in WF2 'input' was fired on everything:

   http://www.whatwg.org/specs/web-forms/current-work/#the-change

Since I can't find any rationale for not doing it and nobody has spoken up, I'll do the change.
Comment 5 Ian 'Hixie' Hickson 2013-12-17 23:53:02 UTC
Also <select>. So specifically:

   type=checkbox
   type=radio
       Change the activation behaviour to fire 'input' synchronously with the 
       'change' event, immediately before it.
       Make 'input' apply.

   type=file
       Make 'input' apply.

   "Common event behaviors"
       Add the "activation behaviour" caveat to 'input'.
       Add the "selected files" item to 'input'.

   <select>
       Abstract out the 'change' event prose and add 'input' to it.
Comment 6 contributor 2013-12-19 00:03:59 UTC
Checked in as WHATWG revision r8367.
Check-in comment: Revamp 'input' and 'change' event logic for <input> elements. The primary goal here is to make 'input' events fire on type=checkbox, type=radio, and type=file, but this also improves the way other things here are phrased.
http://html5.org/tools/web-apps-tracker?from=8366&to=8367
Comment 7 contributor 2013-12-19 00:10:58 UTC
Checked in as WHATWG revision r8368.
Check-in comment: Fire 'input' events on <select> also.
http://html5.org/tools/web-apps-tracker?from=8367&to=8368