Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First uploaded file is always in the "Rejected Files" object #2235

Open
butcherman opened this issue May 21, 2023 · 1 comment
Open

First uploaded file is always in the "Rejected Files" object #2235

butcherman opened this issue May 21, 2023 · 1 comment

Comments

@butcherman
Copy link

Describe the bug
I'm trying to implement a basic validation rule by checking that there are no errored files in the queue before I allow it to be processed. The problem is that the first file that is added to the queue is always placed in the "Rejected Files" object so when checking for errored files by using getRejectedFiles() it returns a valid file.

I can remove this file to clear the Rejected Files object, but adding another file goes to the Rejected object again.

This file does get processed and moved to the accepted list when the processQueue() method is called.

To Reproduce
Steps to reproduce the behavior:
Check the following pen: https://codepen.io/butcherman/pen/BaqGgeY?editors=1111
Drag one or more files in the drop box. There is guaranteed to be one file in the Rejected Files portion. Remove files to clear it, and add another file, Rejected Files will be populated again.

Expected behavior
An accepted file should not be in the Rejected Files list

Browser / OS:

  • Tested in Chrome, Firefox, and Edge
  • Dropzone v5.9.3
@fusscreme
Copy link

fusscreme commented Aug 22, 2023

same issue with 6.0.0-beta.2

I fixed it by putting my function in a 'setTimeout', e.g.:

setTimeout(() => {
if (myDropzone.getRejectedFiles().length > 0) {
// do this
} else {
// do that
}
}, 10);

stupid hack but it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants