Fix getting multiple files from drag event
This commit is contained in:
parent
5e13c8bd91
commit
b630c74b21
@ -640,13 +640,16 @@ export async function getFilesFromEvent(e: ClipboardEvent | DragEvent, onlyTypes
|
||||
// @ts-ignore
|
||||
const items = (e.dataTransfer || e.clipboardData || e.originalEvent.clipboardData).items;
|
||||
|
||||
const promises: Promise<any>[] = [];
|
||||
for(let i = 0; i < items.length; ++i) {
|
||||
const item: DataTransferItem = items[i];
|
||||
if(item.kind === 'file') {
|
||||
const entry = onlyTypes ? item : item.webkitGetAsEntry() || item.getAsFile();
|
||||
await scanFiles(entry);
|
||||
const entry = (onlyTypes ? item : item.webkitGetAsEntry()) || item.getAsFile();
|
||||
promises.push(scanFiles(entry));
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(promises);
|
||||
}
|
||||
|
||||
/* if(!onlyTypes) {
|
||||
|
Loading…
Reference in New Issue
Block a user