|
@@ -26,6 +26,7 @@ module.exports = class DragDrop extends Plugin {
|
|
|
const defaultOpts = {
|
|
|
target: null,
|
|
|
inputName: 'files[]',
|
|
|
+ allowMultipleFiles: true,
|
|
|
width: '100%',
|
|
|
height: '100%',
|
|
|
note: '',
|
|
@@ -103,11 +104,15 @@ module.exports = class DragDrop extends Plugin {
|
|
|
}
|
|
|
|
|
|
render (state) {
|
|
|
- const DragDropClass = `uppy uppy-DragDrop-container ${this.isDragDropSupported ? 'is-dragdrop-supported' : ''}`
|
|
|
+ const DragDropClass = `uppy-Root uppy-DragDrop-container ${this.isDragDropSupported ? 'is-dragdrop-supported' : ''}`
|
|
|
const DragDropStyle = {
|
|
|
width: this.opts.width,
|
|
|
height: this.opts.height
|
|
|
}
|
|
|
+
|
|
|
+ // empty value="" on file input, so that the input is cleared after a file is selected,
|
|
|
+ // because Uppy will be handling the upload and so we can select same file
|
|
|
+ // after removing — otherwise browser thinks it’s already selected
|
|
|
return (
|
|
|
<div class={DragDropClass} style={DragDropStyle}>
|
|
|
<div class="uppy-DragDrop-inner">
|
|
@@ -118,9 +123,10 @@ module.exports = class DragDrop extends Plugin {
|
|
|
<input class="uppy-DragDrop-input"
|
|
|
type="file"
|
|
|
name={this.opts.inputName}
|
|
|
- multiple
|
|
|
+ multiple={this.opts.allowMultipleFiles}
|
|
|
ref={(input) => { this.input = input }}
|
|
|
- onchange={this.handleInputChange} />
|
|
|
+ onchange={this.handleInputChange}
|
|
|
+ value="" />
|
|
|
{this.i18n('dropHereOr')} <span class="uppy-DragDrop-dragText">{this.i18n('browse')}</span>
|
|
|
</label>
|
|
|
<span class="uppy-DragDrop-note">{this.opts.note}</span>
|