Max number of files when dropzone has multiple prop
See original GitHub issueDo you want to request a feature or report a bug?
- I found a bug
- I want to propose a feature
What is the current behavior?
When the multiple prop is on the dropzone, there is no limitation to the number of files a user can drop.
If this is a feature request, what is motivation or use case for changing the behavior?
I had to make a few tricks to limit the number of files the dropzone takes when it has a multiple prop. How about adding a prop to the dropzone like ‘maxNumberFiles’ that would make the dropzone reject all the files or the exceeding ones ?
Maybe it would be more convenient directly in the multiple prop likeso : multiple={3}
and that would not have any limit if left empty
I had to do it on top of the dropzone in my component which is a bit messy even though it works fine 😅
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:6
Top Results From Across the Web
getRootProps - react-dropzone
Prop name Type Default
autoFocus bool false
children func
disabled bool false
Read more >DropzoneJS limit selecting of files to one file but allow ...
Instead of patching the DropZone library, you could do this change at runtime after you initialized the DropZone element.
Read more >Configuration Options - Dropzone
Configuration Options ; maxFilesize. 256. The maximum filesize (in bytes) that is allowed to be uploaded. ; paramName. "file". The name of the...
Read more >React Dropzone and File Uploads in React - Upmostly
Luckily we can limit the size of the file that's being uploaded in React Dropzone through two props, minSize and maxSize. Both of...
Read more >File input component — Vuetify
When using the show-size property along with counter, the total number of files and size will be displayed under the input.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this is how you guys do it
Hello @okonet and sorry for taking so long. Here is a video sample of what I built using dropzones : https://www.useloom.com/share/8ad3082bec7c4d7abe0d5ef8cc561db7
In this demo you can see :
You can click on the trash icon to delete your item, once you click on the form submit button, it disables the dropzones while uploading the files. If you reload the page, we disable the dropzones and display a message saying we got all your files already.
Here’s a gist of these custom dropzones, it could be refacto but eh, it has been working fine for a while 😃
https://gist.github.com/RaphaelRegnier/797015e23a64e8959182528646b46954