File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/ui-file-drop/src/FileDrop Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,12 @@ class FileDrop extends Component<FileDropProps, FileDropState> {
231231 const [ accepted , rejected ] = this . parseFiles ( fileList )
232232 e . preventDefault ( )
233233 this . enterCounter = 0
234+ // When dropping a file the browser does not populate the input's
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
237+ if ( accepted . length > 0 && 'dataTransfer' in e ) {
238+ this . fileInputEl ! . files = e . dataTransfer ! . files
239+ }
234240 onDrop && onDrop ( accepted , rejected , e as React . DragEvent )
235241 if ( rejected . length > 0 && onDropRejected ) {
236242 onDropRejected ( rejected , e )
You can’t perform that action at this time.
0 commit comments