uppy
uppy copied to clipboard
Nested folder selection does not work correctly
Initial checklist
- [X] I understand this is a bug report and questions should be posted in the Community Forum
- [X] I searched issues and couldn’t find anything (or linked relevant results below)
Link to runnable example
No response
Steps to reproduce
Create a directory structure in OneDrive similar to this:
Folder A
| Folder B
| File A
- In the uploader, tick the checkbox for Folder A.
- Then go into Folder A and tick the checkbox for Folder B.
- Click "Select"
Note:
- I am testing this on OneDrive. The issue with selection is the same for all providers, but OneDrive displays the issue of File A being duplicated.
Expected behavior
- Only one file, File A, should be listed.
- Technically, ticking the checkbox for Folder A should automatically tick the checkbox for all of its children (i.e. if parent is selected, all child files/folders should be selected, and vice versa), so we shouldn't need to manually tick the checkbox for Folder B anyway.
- If only some child files/folders are selected, the parent checkbox should be
indeterminate:
Actual behavior
- File A is listed twice instead of once.
- Selecting parent folder is independent of selecting children. Selecting Folder A does not check Folder B, and allows you to select it separately.
- Deselecting Folder A doesn't deselect Folder B, so we can never tell which parent folders may contain selected files.
I can reproduce this issue, and I think your suggestions are sound - will take a look into it.
Fixed in https://github.com/transloadit/uppy/pull/5050