Skip to content

Commit 3a74e48

Browse files
committed
Update validation when folder.
1 parent b01c007 commit 3a74e48

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/controls/dragDropFiles/DragDropFiles.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,26 @@ export class DragDropFiles extends React.Component<IDragDropFilesProps, IDragDro
122122
*/
123123
if (item.getAsEntry) {
124124
entry = item.getAsEntry();
125-
Directory.push(entry);
125+
if (entry.isDirectory) {
126+
Directory.push(entry);
127+
} else {
128+
const file = item.getAsFile();
129+
if (file) {
130+
file.fullPath = "";
131+
files.push(file);
132+
}
133+
}
126134
} else if (item.webkitGetAsEntry) {
127135
entry = item.webkitGetAsEntry();
128-
Directory.push(entry);
136+
if (entry.isDirectory) {
137+
Directory.push(entry);
138+
} else {
139+
const file = item.getAsFile();
140+
if (file) {
141+
file.fullPath = "";
142+
files.push(file);
143+
}
144+
}
129145
} else if ("function" == typeof item.getAsFile) {
130146
const file = item.getAsFile();
131147
if (file) {

0 commit comments

Comments
 (0)