- From: MichaelAllenWarner <notifications@github.com>
- Date: Tue, 21 Sep 2021 12:11:47 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 21 September 2021 19:11:59 UTC
It would be useful if `HTMLElement.click()` accepted an optional `Number` argument that became the value of the synthetic event's `detail` property (representing the click-count). Currently, one can do something like `EventTarget.dispatchEvent(new MouseEvent('click', { detail: 1 }))` to achieve more-or-less the same thing, but: 1. it's a bit ugly and cumbersome; and 2. it's not _quite_ the same thing, at least in terms of implementation. For example, in all browsers that I tested, `HTMLElement.click()` has no effect when the target is a disabled button, but when I tried using `EventTarget.dispatchEvent()` to fire a click-event on a disabled button, I found that behavior differed across browsers—e.g., in Safari the event-handler was executed, and in Chrome it was not. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/1018
Received on Tuesday, 21 September 2021 19:11:59 UTC