Closed Bug 1424310 Opened 7 years ago Closed 7 years ago

Disabled button does not receive custom events

Categories

(Core :: DOM: Events, defect)

59 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 329509

People

(Reporter: voreny.gelio, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce:

Try to invoke `dispatchEvent` on a button that is `disabled`. The dispatched event is a custom event that has a listener registered already.

A code example is available here: https://codepen.io/Voreny/pen/Bmgbmx


Actual results:

The listener is not invoked as long as the button is disabled.


Expected results:

The listener should be invoked. That is what both Chrome (62) and Edge (41) do.
Is this a duplicate of bug 329509?
Flags: needinfo?(bugs)
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #1)
> Is this a duplicate of bug 329509?

One may say so, yet this one is regarding CustomEvents, not native events. While I agree not emitting native events like click does make sense, preventing CustomEvent dispatching does not, at least to me.
This is a dup yes.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Flags: needinfo?(bugs)
Resolution: --- → DUPLICATE
A bug from 12 years ago is still marked as normal priority while here we have an element that does not react to custom events so that triggering/propagating something like `button.disatchEvent(new Event('re-activate'))` won't make it ever possible to re-activate a disabled button.

How can we re-prioritize this issue only Firefox shows?

Patching it would make it slower and override HTMLButtonElement and HTMLInputElement or any other element prototype would make it weak.
So, P2 on bug 329509 is quite high priority. I'd expect us to get to it relatively soon (i.e., next year, but not years).
You need to log in before you can comment on or make changes to this bug.