修复上传关闭自动上传后,表单提交数据丢失问题

This commit is contained in:
2betop 2020-01-09 16:09:54 +08:00
parent 4c5d0fccf5
commit cdf5a77f7d
2 changed files with 6 additions and 6 deletions

View File

@ -457,7 +457,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
uploading: false
},
() => {
this.onChange();
this.onChange(!!this.resolve);
if (this.resolve) {
this.resolve(
@ -587,7 +587,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
});
}
onChange() {
onChange(changeImmediately?: boolean) {
const {
multiple,
onChange,
@ -620,7 +620,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
value = typeof resetValue === 'undefined' ? '' : resetValue;
}
onChange((this.emitValue = value));
onChange((this.emitValue = value), undefined, changeImmediately);
}
uploadFile(

View File

@ -438,7 +438,7 @@ export default class ImageControl extends React.Component<
locked: false
},
() => {
this.onChange();
this.onChange(!!this.resolve);
if (this.resolve) {
this.resolve(
@ -499,7 +499,7 @@ export default class ImageControl extends React.Component<
});
}
onChange() {
onChange(changeImmediately?: boolean) {
const {
multiple,
onChange,
@ -533,7 +533,7 @@ export default class ImageControl extends React.Component<
: newValue;
}
onChange((this.emitValue = newValue));
onChange((this.emitValue = newValue), undefined, changeImmediately);
}
handleSelect() {