mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
fix: onChange should always return proxy file (#29627)
This commit is contained in:
parent
9b82fafb7e
commit
ef4b67d4c4
@ -129,7 +129,7 @@ const InternalUpload: React.ForwardRefRenderFunction<unknown, UploadProps> = (pr
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onInternalChange(filteredFileInfoList[0]?.file, newFileList);
|
onInternalChange(objectFileList[0], newFileList);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onStart = (file: RcFile) => {
|
const onStart = (file: RcFile) => {
|
||||||
|
@ -635,12 +635,12 @@ describe('Upload', () => {
|
|||||||
|
|
||||||
switch (callTimes) {
|
switch (callTimes) {
|
||||||
case 1:
|
case 1:
|
||||||
|
expect(e.file.originFileObj).toBeTruthy();
|
||||||
expect(file.status).toBe(undefined);
|
expect(file.status).toBe(undefined);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
console.log('===>', file.status);
|
|
||||||
expect(file).toEqual(expect.objectContaining({ status: 'uploading', percent: 0 }));
|
expect(file).toEqual(expect.objectContaining({ status: 'uploading', percent: 0 }));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user