You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using react-dropzone as a way to populate a React-Hook-Form with images.
I am using the onDrop callback which expects a list with acceptedFiles, that I can then use to append the images to the form.
What I have noticed is that when I use the maxFiles flag with a number bigger than the number of images dropped; or multiple flag to false, and I drop more than one image; the onDrop callback does not return any image in the acceptedFiles list.
As per the documentation:
If multiple is set to false and additional files are dropped, all files besides the first will be rejected. Any file which does not have a size in the [minSize, maxSize] range, will be rejected as well.
I expected the first file to be returned and the rest to be rejected in the case where I set multiple to false, and the files within the maxFiles range to be returned. Right now all files are rejected.
The text was updated successfully, but these errors were encountered:
I am using react-dropzone as a way to populate a React-Hook-Form with images.
I am using the onDrop callback which expects a list with acceptedFiles, that I can then use to append the images to the form.
What I have noticed is that when I use the maxFiles flag with a number bigger than the number of images dropped; or multiple flag to false, and I drop more than one image; the onDrop callback does not return any image in the acceptedFiles list.
See codesandbox: https://codesandbox.io/p/sandbox/react-dropzone-on-drop-not-returning-acceptedfiles-lkt5fg?file=%2Fsrc%2FApp.tsx%3A21%2C12
In this sandbox I have used maxFiles but setting multiple to false shows the same result.
As per the documentation:
If multiple is set to false and additional files are dropped, all files besides the first will be rejected. Any file which does not have a size in the [minSize, maxSize] range, will be rejected as well.
I expected the first file to be returned and the rest to be rejected in the case where I set multiple to false, and the files within the maxFiles range to be returned. Right now all files are rejected.
The text was updated successfully, but these errors were encountered: