-
Notifications
You must be signed in to change notification settings - Fork 344
Description
Environment:
- Elements version: 25.4.0
Desktop (please complete the following information):
- OS: macOS Sequoia
- Browser: Safari, Firefox, Chrome
Steps to reproduce the problem:
- Visit the uploader doc page. It even happens here. Easier than coming up with a demo app.
- Drop two files on the uploader area. Do not start an upload.
- Cancel one of them.
- Drop the same file you just cancelled
- Scratch your head wondering why the file didn't show up in the list
What is the expected behavior? (Screenshots can be helpful here)
The cancelled file should reappear as a item in the item list.
What went wrong? (Screenshots, console logs, or HAR files can be helpful here)
The state.itemIds object keys (stored here in the code) for the cancelled file were not removed. If a file with a name that matches a key in the itemIds object then that file will not be accepted. You can delete the key matching the filename from state.itemIds, ignoring the longer file id key for the same file, and it will accept the file into the file list again.
The only way to drop the cancelled file again is to remove all files from the list. This resets the itemIds object and so no key collision happens, thus accepting the cancelled file again.
Link to application or sample code:
Link to application? How about the docs. :) https://developer.box.com/guides/embed/ui-elements/uploader/