Drag and Drop doesn't work for multiple files
Describe the bug "Drag and drop files or folders here" makes it seem as though the drag and drop should allow multiple selected files, however, only one of the selected files will show in the list of files to be uploaded.
To Reproduce Steps to reproduce the behavior:
- Select multiple files
- Drag into drop area in web UI
- Only one file lists for upload
Expected behavior All files from drag and drop selection appear in pending upload list
Desktop (please complete the following information):
- OS: macOS 15.5
- Browser: Chrome
@abiteman this seems to be related to the block:
for (const item of dataTransferItems) {
const entry = item.webkitGetAsEntry();
if (entry) {
console.debug('Found item for traversal:', {
name: entry.name,
isFile: entry.isFile,
isDirectory: entry.isDirectory
});
await traverseEntry(entry);
}
}
Something in await traverseEntry(entry); is breaking the subsequent items, so that item.webkitGetAsEntry(); returns null
One way that this can be resolved is to create an intermediate list:
const entriesToTraverse = [];
for (const item of dataTransferItems) {
const entry = item.webkitGetAsEntry();
if (entry) {
console.debug('Found item for traversal:', {
name: entry.name,
isFile: entry.isFile,
isDirectory: entry.isDirectory
});
entriesToTraverse.push(entry);
}
}
for (const entry of entriesToTraverse) {
console.debug('Processing root level item:', {
name: entry.name,
isFile: entry.isFile,
isDirectory: entry.isDirectory
});
await traverseEntry(entry);
}
This solution is a bit of a band-aid, as it doesn't get to the root of the issue, but if this is acceptable, I can open a PR with a fix.