Skip to content

Commit f6e1859

Browse files
committed
refactor(ui-file-drop): fix comment on value prop
1 parent f6233cf commit f6e1859

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/ui-file-drop/src/FileDrop/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,8 @@ class FileDrop extends Component<FileDropProps, FileDropState> {
232232
e.preventDefault()
233233
this.enterCounter = 0
234234
// When dropping a file the browser does not populate the input's
235-
// 'files' property, so we need to do it manually.
236-
// Browsers do not allow setting the 'value' of file inputs for security,
237-
// so it will be empty here.
238-
this.fileInputEl!.value = ''
235+
// 'files' property, so we need to do it manually. This will also populate
236+
// the input's 'value' prop, which contains the first file's path
239237
this.fileInputEl!.files = new DataTransfer().files
240238
if (accepted.length > 0 && 'dataTransfer' in e) {
241239
this.fileInputEl!.files = e.dataTransfer!.files

0 commit comments

Comments
 (0)