Commit
- Loading branch information
There are no files selected for viewing
4 comments
on commit 626ebf2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed #8946 too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afc163 为什么 beforeUpload
return false
仍然要触发 onChange
ant-design/components/upload/Upload.tsx
Lines 215 to 225 in bef491e
const result = this.props.beforeUpload(file, fileList); | |
if (result === false) { | |
this.onChange({ | |
file, | |
fileList: uniqBy( | |
this.state.fileList.concat(fileList.map(fileToObject)), | |
(item: UploadFile) => item.uid, | |
), | |
}); | |
return false; | |
} |
ant-design/components/upload/Upload.tsx
Lines 194 to 203 in bef491e
onChange = (info: UploadChangeParam) => { | |
if (!('fileList' in this.props)) { | |
this.setState({ fileList: info.fileList }); | |
} | |
const { onChange } = this.props; | |
if (onChange) { | |
onChange(info); | |
} | |
}; |
之前有过一个 PR 用于解决这个问题
#8299
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
统一使用 lodash/xxx 吧,以后升级依赖版本也方便。