Open Bug 1415440 Opened 8 years ago Updated 1 year ago

resetting shared FileList of input[type=file] doesn't reflect on all inputs

Categories

(Core :: Layout: Form Controls, defect, P3)

54 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: tristan.fraipont, Unassigned)

Details

Attachments

(2 files)

Attached file input_files_bug.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:57.0) Gecko/20100101 Firefox/57.0 Build ID: 20171102181127 Steps to reproduce: create two input[type=file] (inp1 & inp2) On change of inp1, set the files FileList of inp1 to be inp2 one's (inp2.files = inp1.files) At this stage all is fine, they both share the same FileList. Now clear this FileList using inp2.value = null. Actual results: only inp2 value string is reset, inp1 value string stays to what it was, even though inp1.files is now empty Expected results: both inputs should have their value strings reset.
Priority: -- → P3
Some update on this: Now that Firefox do support the [DataTransfer constructor][1], it is now possible to set the input[type="file"]'s files to point to a mutable FileList. This implies that the form control must get updated when this FileList is mutated. Currently, the UI is updated when a prepopulated FileList is set, but not when the underlying FileList is mutated. Also, these new features implies that an input[type=file]:not([multiple]) can actually hold multiple Files in its FileList. Not sure what this implies, nor where it should best be discussed, but felt here was a good starting point. [1](https://bugzilla.mozilla.org/show_bug.cgi?id=1351193)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: