fix: 修复combo中配置 clearValueOnHidden 无法删除item问题 (#2454)

This commit is contained in:
RickCole 2021-08-27 13:16:29 +08:00 committed by GitHub
parent efc2359826
commit a1d12ebdac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -320,10 +320,6 @@ export function wrapControl<
this.hook3 && this.props.removeHook?.(this.hook3, 'flush');
// this.lazyEmitChange.flush();
if (this.model?.clearValueOnHidden) {
this.props.onChange?.(undefined, this.model.name);
}
this.lazyEmitChange.cancel();
this.reaction?.();
this.disposeModel();
@ -347,6 +343,9 @@ export function wrapControl<
isAlive(formItem) &&
formItem.removeSubFormItem(this.model);
this.model.clearValueOnHidden &&
this.model.form?.deleteValueByName(this.model.name);
rootStore.removeStore(this.model);
}
delete this.model;