Is it possible to allow multiple files drop, but still limit it to a certain number? For example only allow at most 20 files to be dropped at a time.
I'd think that was something to be handled by your onDrop function
@ktalebian I believe @moosch is correct you can overwrite the onDrop function to handle your use case.
Yes. Use onDrop callback.
onDrop={acceptedFiles => {
// do nothing if no files
let handleDropImages;
if (acceptedFiles.length === 0) {
return;
} else if(acceptedFiles.length > 5){ // here i am checking on the number of files
return notify('maxImages'); // here i am using react toaster to get some notifications. don't need to use it
}else {
// do what ever you want
}
}}
Most helpful comment