Jelajahi Sumber

Remove `allowMultipleFiles` and update docs to talk about restrictions

Artur Paikin 7 tahun lalu
induk
melakukan
d7abb71b59

+ 1 - 2
src/plugins/DragDrop/index.js

@@ -26,7 +26,6 @@ module.exports = class DragDrop extends Plugin {
     const defaultOpts = {
     const defaultOpts = {
       target: null,
       target: null,
       inputName: 'files[]',
       inputName: 'files[]',
-      allowMultipleFiles: true,
       width: '100%',
       width: '100%',
       height: '100%',
       height: '100%',
       note: null,
       note: null,
@@ -139,7 +138,7 @@ module.exports = class DragDrop extends Plugin {
               ref={(input) => {
               ref={(input) => {
                 this.input = input
                 this.input = input
               }}
               }}
-              onchange={this.handleInputChange} 
+              onchange={this.handleInputChange}
               value="" />
               value="" />
             {this.i18n('dropHereOr')} <span class="uppy-DragDrop-dragText">{this.i18n('browse')}</span>
             {this.i18n('dropHereOr')} <span class="uppy-DragDrop-dragText">{this.i18n('browse')}</span>
           </label>
           </label>

+ 0 - 1
src/plugins/FileInput.js

@@ -19,7 +19,6 @@ module.exports = class FileInput extends Plugin {
     // Default options
     // Default options
     const defaultOptions = {
     const defaultOptions = {
       target: null,
       target: null,
-      allowMultipleFiles: true,
       pretty: true,
       pretty: true,
       inputName: 'files[]',
       inputName: 'files[]',
       locale: defaultLocale
       locale: defaultLocale

+ 2 - 5
website/src/docs/dragdrop.md

@@ -16,7 +16,6 @@ uppy.use(DragDrop, {
   target: null,
   target: null,
   width: '100%',
   width: '100%',
   height: '100%',
   height: '100%',
-  allowMultipleFiles: true,
   note: null,
   note: null,
   locale: {
   locale: {
     strings: {
     strings: {
@@ -27,6 +26,8 @@ uppy.use(DragDrop, {
 })
 })
 ```
 ```
 
 
+> Note that certain [restrictions set in Uppy’s main options](/docs/uppy#restrictions), namely `maxNumberOfFiles` and `allowedFileTypes`, affect the system file picker dialog. If `maxNumberOfFiles: 1`, users will only be able to select one file, and `allowedFileTypes: ['image/*, .jpg']` means only image or files with `.jpg` extension will be selectable.
+
 ### `target: null`
 ### `target: null`
 
 
 DOM element, CSS selector, or plugin to place the drag and drop area into.
 DOM element, CSS selector, or plugin to place the drag and drop area into.
@@ -39,10 +40,6 @@ Drag and drop area width, set in inline CSS, so feel free to use percentage, pix
 
 
 Drag and drop area height, set in inline CSS, so feel free to use percentage, pixels or other values that you like.
 Drag and drop area height, set in inline CSS, so feel free to use percentage, pixels or other values that you like.
 
 
-### `allowMultipleFiles: true`
-
-Whether to allow user to select multiple files at once via the system file dialog.
-
 ### `note: null`
 ### `note: null`
 
 
 Optionally specify a string of text that explains something about the upload for the user. This is a place to explain `restrictions` that are put in place. For example: `'Images and video only, 2–3 files, up to 1 MB'`.
 Optionally specify a string of text that explains something about the upload for the user. This is a place to explain `restrictions` that are put in place. For example: `'Images and video only, 2–3 files, up to 1 MB'`.

+ 2 - 5
website/src/docs/fileinput.md

@@ -14,7 +14,6 @@ permalink: docs/fileinput/
 ```js
 ```js
 uppy.use(FileInput, {
 uppy.use(FileInput, {
   target: null,
   target: null,
-  allowMultipleFiles: true,
   pretty: true,
   pretty: true,
   inputName: 'files[]',
   inputName: 'files[]',
   locale: {
   locale: {
@@ -25,14 +24,12 @@ uppy.use(FileInput, {
 })
 })
 ```
 ```
 
 
+> Note that certain [restrictions set in Uppy’s main options](/docs/uppy#restrictions), namely `maxNumberOfFiles` and `allowedFileTypes`, affect the system file picker dialog. If `maxNumberOfFiles: 1`, users will only be able to select one file, and `allowedFileTypes: ['image/*, .jpg']` means only image or files with `.jpg` extension will be selectable.
+
 ### `target: null`
 ### `target: null`
 
 
 DOM element, CSS selector, or plugin to mount the file input into.
 DOM element, CSS selector, or plugin to mount the file input into.
 
 
-### `allowMultipleFiles: true`
-
-Whether to allow the user to select multiple files at once.
-
 ### `pretty: true`
 ### `pretty: true`
 
 
 When true, display a styled button (see [example](/examples/xhrupload)) that, when clicked, opens the file selector UI. When false, a plain old browser `<input type="file">` element is shown.
 When true, display a styled button (see [example](/examples/xhrupload)) that, when clicked, opens the file selector UI. When false, a plain old browser `<input type="file">` element is shown.