Skip to content

Commit 29c95a6

Browse files
committed
chore: fix
1 parent c119daa commit 29c95a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AjaxUploader.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint react/no-is-mounted:0,react/sort-comp:0,react/prop-types:0 */
2-
import { clsx } from 'clsx';
32
import pickAttrs from '@rc-component/util/lib/pickAttrs';
3+
import { clsx } from 'clsx';
44
import React, { Component } from 'react';
55
import attrAccept from './attr-accept';
66
import type {
@@ -35,10 +35,10 @@ class AjaxUploader extends Component<UploadProps> {
3535
};
3636

3737
onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
38-
const { accept } = this.props;
38+
const { accept, directory } = this.props;
3939
const { files } = e.target;
4040
const acceptedFiles = [...files].filter(
41-
(file: RcFile) => this.isNativeDirectory() || attrAccept(file, accept),
41+
(file: RcFile) => !directory || this.isNativeDirectory() || attrAccept(file, accept),
4242
);
4343
this.uploadFiles(acceptedFiles);
4444
this.reset();

0 commit comments

Comments
 (0)