diff --git a/src/useForm.ts b/src/useForm.ts index 2fdd233c..4a083230 100644 --- a/src/useForm.ts +++ b/src/useForm.ts @@ -586,7 +586,8 @@ export class FormStore { data: fieldData, }); }); - + //validation of the fields to be rerun when someone sets the value using setFields/setFieldValue + this.validateFields(namePathList) this.notifyWatch(namePathList); }; @@ -764,16 +765,18 @@ export class FormStore { this.warningUnhooked(); const prevStore = this.store; - + const namesLists = Object.keys(store); if (store) { const nextStore = merge(this.store, store); this.updateStore(nextStore); - } + } this.notifyObservers(prevStore, null, { type: 'valueUpdate', source: 'external', }); + //validation of the fields to be rerun when someone sets the value using setFieldsValue + this.validateFields(namesLists) this.notifyWatch(); };