NEW 227698
Can't open <input type=color> with HTMLElement.click() when color input created as part of click event
https://bugs.webkit.org/show_bug.cgi?id=227698
Summary Can't open <input type=color> with HTMLElement.click() when color input creat...
Dan
Reported 2021-07-06 02:47:22 PDT
Created attachment 432913 [details] input type=color vs. type=file in various scenarios As with other types of inputs, color inputs can be activated by calling their `HTMLElement.click()` method. However, invoking `inputElement.click()` immediately after creating the `inputElement` DOM element and attaching it to the document tree has no effect. Other types of inputs (e.g. `file`) works well even in this scenario. In the attached test case: A. Open existing input element with immediate `click()` — works for both `file` and `color` types; B. Open existing input element with delayed `click()` — works for both `file` and `color` types; C. Create input element as part of gesture, immediate `click()` — works for `file` type but NOT `color` type; D. Create input element as part of gesture, delayed `click()` — works for both `file` and `color` types. In other words: * color inputs don't work in scenario C, although it seems they should; * color inputs can be made to work by delaying the `click()` call with `window.setTimeout(() => { inputEl.click(); }, 0)`.
Attachments
input type=color vs. type=file in various scenarios (1.75 KB, text/html)
2021-07-06 02:47 PDT, Dan
no flags
Radar WebKit Bug Importer
Comment 1 2021-07-13 02:48:21 PDT
Note You need to log in before you can comment on or make changes to this bug.