Commit 8711fa2 1 parent 370d124 commit 8711fa2 Copy full SHA for 8711fa2
File tree 1 file changed +5
-1
lines changed
src/components/MediaLibrary
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -112,17 +112,21 @@ class MediaLibrary extends React.Component {
112
112
handlePersist = async event => {
113
113
/**
114
114
* Stop the browser from automatically handling the file input click, and
115
- * get the file for upload.
115
+ * get the file for upload, and retain the synthetic event for access after
116
+ * the asynchronous persist operation.
116
117
*/
117
118
event . stopPropagation ( ) ;
118
119
event . preventDefault ( ) ;
120
+ event . persist ( ) ;
119
121
const { persistMedia, privateUpload } = this . props ;
120
122
const { files : fileList } = event . dataTransfer || event . target ;
121
123
const files = [ ...fileList ] ;
122
124
const file = files [ 0 ] ;
123
125
124
126
await persistMedia ( file , { privateUpload } ) ;
125
127
128
+ event . target . value = null ;
129
+
126
130
this . scrollToTop ( ) ;
127
131
} ;
128
132
You can’t perform that action at this time.
0 commit comments