Checkbox input fires click & change events in wrong order

Confirmed Issue #6274500 • Assigned to Jonathan H.

Details

Created
Jan 22, 2016
Privacy
This issue is public.
Reports
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

URL:

Repro Steps:

  1. Open http://jsfiddle.net/cvrebert/Lxwc1eah/show/ in Edge or IE11.
  2. Open the JS console.
  3. Click the webpage’s checkbox so as to check it.
  4. Observe the JS console output.

Edge & IE11 incorrectly output:
change
click

Expected Results:

The click event should fire before the change event (as opposed to the other way around).
In the example, after following the steps, the console should read:
click
change

Actual Results:

Dev Channel specific:

No

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Mara P.”

      Changed Assigned To to “Sermet I.”

      Changed Assigned To to “Bogdan B.”

      Changed Assigned To from “Bogdan B.” to “Jonathan H.”

      Changed Status to “Confirmed”

    • Per the HTML spec, clicking on an `` should cause a click event to be fired and then subsequently a change event to be fired. However, Edge fires these events in the wrong order; it fires change and then fires click.

      Relevant portions of the spec:

      https://html.spec.whatwg.org/multipage/interaction.html#run-authentic-click-activation-steps

      When a user agent is to [[[run authentic click activation steps]]] for a given event event, it must follow these steps:
      […]
      6. Dispatch event (the required click event) at target.
      If there is an element e and the click event is not canceled, [[[run post-click activation steps]]] on element e.

      https://html.spec.whatwg.org/multipage/interaction.html#run-post-click-activation-steps

      When a user agent is to [[[run post-click activation steps]]] on an element, it must run the [[[activation behaviour]]] defined for that element, if any.

      https://html.spec.whatwg.org/multipage/forms.html#checkbox-state-(type=checkbox):activation-behaviour

      4.10.5.1.16 Checkbox state (type=checkbox)
      The [[[activation behaviour]]] is to fire a simple event that bubbles named input at the element and then fire a simple event that bubbles named change at the element.

    • Added a new test case page since the original is 404’ing.

      https://eventorder.glitch.me/

      Note that the issue affects checkboxes AND radio buttons, and is a carry over bug from Internet Explorer (this is not new to Edge)

    • Seems the issue tracker’s Markdown is broken. The original link should be:

      http://jsfiddle.net/cvrebert/Lxwc1eah/show/

    You need to sign in to your Microsoft account to add a comment.

    Sign in