RESOLVED FIXED 180465
change event is dispatched when .files property is set at <input type="file"> element
https://bugs.webkit.org/show_bug.cgi?id=180465
Summary change event is dispatched when .files property is set at <input type="file">...
guest271314
Reported 2017-12-05 22:56:04 PST
Created attachment 328552 [details] change event dispatched when .files set at <input type="file"> Programmatically set .files property of <input type="file"> element to a FileList object Expected behaviour: change event should not be dispatched to the element Actual result: change event is dispatched to the element Browser: Chromium 62 See https://bugs.chromium.org/p/chromium/issues/detail?id=792336, https://github.com/whatwg/html/issues/3269
Attachments
change event dispatched when .files set at <input type="file"> (1.86 KB, application/javascript)
2017-12-05 22:56 PST, guest271314
no flags
Patch (10.42 KB, patch)
2021-08-24 13:29 PDT, Chris Dumez
no flags
Simon Fraser (smfr)
Comment 1 2019-06-16 21:17:30 PDT
Does this reproduce in Safari? Chrome bugs should be filed in the Chromium bug tracker.
Kaiido
Comment 2 2021-08-04 18:34:48 PDT
This is a Safari only bug, still reproducible in current TP Release 128 (Safari 15.0, WebKit 16612.1.22.11.3) Here is a fiddle reproducing the issue: https://jsfiddle.net/34sxmbqc/ Specs (https://html.spec.whatwg.org/multipage/input.html#dom-input-files) do not ask to fire an event here, since the change has been caused by script manipulation. The particularly alarming point is that this event even has the `isTrusted` property set to `true`.
Chris Dumez
Comment 3 2021-08-24 13:29:14 PDT
EWS
Comment 4 2021-08-24 16:32:05 PDT
Committed r281527 (240899@main): <https://commits.webkit.org/240899@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 436325 [details].
Radar WebKit Bug Importer
Comment 5 2021-08-24 16:33:27 PDT
Note You need to log in before you can comment on or make changes to this bug.