Skip to content

Commit

Permalink
Bugfix: Dropzone thinks custom file extensions are folders
Browse files Browse the repository at this point in the history
  • Loading branch information
loivsen committed Sep 19, 2024
1 parent fc19b5d commit 96a1fdd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/uui-file-dropzone/lib/uui-file-dropzone.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ export class UUIFileDropzoneElement extends LabelMixin('', LitElement) {
for (const entry of queue) {
if (entry?.kind !== 'file') continue;

if (entry.type) {
const fileEntry = this._getEntry(entry);
if (!fileEntry) continue;

if (!fileEntry.isDirectory) {
// Entry is a file
const file = entry.getAsFile();
if (!file) continue;
Expand All @@ -125,12 +128,8 @@ export class UUIFileDropzoneElement extends LabelMixin('', LitElement) {
}
} else if (!this.disallowFolderUpload && this.multiple) {
// Entry is a directory
const dir = this._getEntry(entry);

if (dir) {
const structure = await this._mkdir(dir);
folders.push(structure);
}
const structure = await this._mkdir(fileEntry);
folders.push(structure);
}
}

Expand Down

0 comments on commit 96a1fdd

Please sign in to comment.