react-widget
react-widget copied to clipboard
Problem with multiple files when multimax option is set
Question
I'm trying to limit the number of files uploaded on an instance of the widget. My problem is that I can select more than the specified limit and I get a message specifying the limit.... However the selected files still get uploaded. example: I set the limit to 3 files. I can select 5 files in the selection window and when the selection window closes the widget reports only 3 files may be selected. When I check my project on uploadcare I see all 5 were uploaded. What am I doing wrong?
Hey @ehudmi, this is expected behaviour. Widget uploads all files regardless of the limit, it just doesn't let the user submit if the number of files isn't fit the limit.
But you could subscribe to the new files and cancel uploading if their number doesn't fit. Here is the example - https://codesandbox.io/embed/cancel-extra-uploads-1h0ibj?codemirror=1