Open erykpiast opened 5 years ago
According to this code and this test show that there is one single case when active status may be both active
and rejected
- all files were valid but there were more then one of those and multiple
flag was set to false
.
Maybe it's good idea to introduce rejection reason concept? Inactive (Accepted | Rejected(WrongFormat | TooMany)) | Active
.
Funny thing is, if some file exceeds maxSize
or is smaller than minSize
, it's added to rejectedFiles
array but isDragReject
isn't set to true
. EDIT: it's because these are dragging-in-progress flags, while acceptedFiles
and rejectedFiles
are post-drag collections. According to this issue there is no way to check file size before dropping it.
react-dropzone
exposes three booleans representing (potentially) single state:isDragActive
,isDragAccept
andisDragReject
. It may be modeled with variants asInactive (Accepted | Rejected) | Active
. Unified property may be calleddragStatus
.The hypothesis has to be verified. What happens when some files were accepted and some of them rejected? Does the possibility exist that
accepted
orrejected
istrue
whenactive
istrue
?