mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-15 09:21:13 +08:00
fix(InputImage): 细节调整 (#5964)
This commit is contained in:
parent
afbfe5a180
commit
2ae83e9aa4
@ -783,7 +783,7 @@ export default class ImageControl extends React.Component<
|
||||
});
|
||||
}
|
||||
|
||||
async onChange(changeImmediately?: boolean, changeEvent: boolean = true) {
|
||||
async onChange(changeImmediately?: boolean, changeEvent: boolean = true, initAutoFill?: boolean) {
|
||||
const {
|
||||
multiple,
|
||||
onChange,
|
||||
@ -792,6 +792,7 @@ export default class ImageControl extends React.Component<
|
||||
delimiter,
|
||||
valueField
|
||||
} = this.props;
|
||||
const curInitAutoFill = initAutoFill ?? true;
|
||||
|
||||
const files = this.files.filter(
|
||||
file => file.state == 'uploaded' || file.state == 'init'
|
||||
@ -825,7 +826,7 @@ export default class ImageControl extends React.Component<
|
||||
}
|
||||
|
||||
onChange((this.emitValue = newValue || ''), undefined, changeImmediately);
|
||||
this.syncAutoFill();
|
||||
curInitAutoFill && this.syncAutoFill();
|
||||
}
|
||||
|
||||
syncAutoFill() {
|
||||
@ -1244,7 +1245,11 @@ export default class ImageControl extends React.Component<
|
||||
this.setState(
|
||||
{
|
||||
files: (this.files = files)
|
||||
} // , !needUploading ? this.onChange : undefined
|
||||
}, () => {
|
||||
if (!needUploading) {
|
||||
this.onChange(false, true, this.initAutoFill);
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
img.src = imgDom.src;
|
||||
|
Loading…
Reference in New Issue
Block a user