W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2015

[whatwg] Regarding spec clarification on dispatching click event on disabled form controls

From: Ramya Vadlamudi <ramya.v@samsung.com>
Date: Thu, 07 May 2015 15:51:24 +0530
To: whatwg@whatwg.org
Message-id: <014601d088af$93f5acb0$bbe10610$@samsung.com>
Regarding the spec clarification,


As per spec1


A form control that is disabled must prevent any click events that are
queued on the user interaction task source from being dispatched on the


Which means except for click events generated by user interaction through
mouse or keyboard, all other generated events should be dispatched to
disabled elements.


As per spec2


The click() method must run the following steps:

If the element is a form control that is disabled, abort these steps.


which means even if DOM click is a generated event it should not be
dispatched to disabled elements, which looks to be bypassing first spec.


For ex: In javascript if button is a HTMLButtonElement

button.click();   -  As per spec2 event should not be dispatched, as per
spec1 event should be dispatched

button.dispatchEvent(new Event('click'));  - As per spec1 event should be


Results in various browsers








Event not dispatched

Event not dispatched

Event not dispatched

button.dispatchEvent(new Event('click'));

Event not dispatched

Event not dispatched

Event dispatched



Can you please clarify what is supposed to be the correct behavior.

Attached sample test file for you reference.


Thanks & Regards,

Received on Thursday, 7 May 2015 10:20:08 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:31 UTC