-
Notifications
You must be signed in to change notification settings - Fork 3
Description
shadcn-dropzone.mp4
When adding multiple images with the shiftOnMaxFiles flag enabled, it should remove the oldest image once the limit is reached. For example, if the limit is 10, uploading the 11th image should remove the first image while keeping the latest ones.
However, this feature is not working correctly. Instead of waiting until the limit is reached, image replacement starts prematurely around 5 images instead of 10 causing unexpected behavior.
Steps to Reproduce:
- Open the provided sandbox: Codesandbox Link
- Drop files up to half of the defined limit.
- Attempt to add more files.
- Observe that new files replace previously added ones instead of being appended.
Suspected Cause:
The issue appears to be in the onDropAccepted function, where the validation logic isn't correctly preventing additional file additions.
Proposed Fix:
I've identified and implemented a fix in my local repository, where the max file limit is properly enforced. I would like to submit a PR to contribute the fix to the main repository.
Let me know if I can proceed with opening a PR or if any clarification is needed.
Best
Dhruv