Browse Source

Merge pull request #534 from transloadit/fix/select-file-value

Empty input value so same file can be selected multiple times
Artur Paikin 7 years ago
parent
commit
64cde695d5
2 changed files with 7 additions and 0 deletions
  1. 3 0
      src/plugins/Dashboard/ActionBrowseTagline.js
  2. 4 0
      src/plugins/Dashboard/Tabs.js

+ 3 - 0
src/plugins/Dashboard/ActionBrowseTagline.js

@@ -11,6 +11,8 @@ class ActionBrowseTagline extends Component {
   }
 
   render () {
+    // empty value=""  on file input, so we can select same file
+    // after removing it from Uppy — otherwise OS thinks it’s selected
     return (
       <span>
         {this.props.acquirers.length === 0
@@ -27,6 +29,7 @@ class ActionBrowseTagline extends Component {
           name="files[]"
           multiple="true"
           onchange={this.props.handleInputChange}
+          value=""
           ref={(input) => {
             this.input = input
           }} />

+ 4 - 0
src/plugins/Dashboard/Tabs.js

@@ -29,6 +29,9 @@ class Tabs extends Component {
       )
     }
 
+    // empty value=""  on file input, so we can select same file
+    // after removing it from Uppy — otherwise OS thinks it’s selected
+
     return <div class="uppy-DashboardTabs">
       <ul class="uppy-DashboardTabs-list" role="tablist">
         <li class="uppy-DashboardTab" role="presentation">
@@ -48,6 +51,7 @@ class Tabs extends Component {
             name="files[]"
             multiple="true"
             onchange={this.props.handleInputChange}
+            value=""
             ref={(input) => { this.input = input }} />
         </li>
         {this.props.acquirers.map((target) => {