Skip to content

Commit 6f2f069

Browse files
committed
feat: test
1 parent 719b59b commit 6f2f069

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/useForm.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -921,9 +921,16 @@ export class FormStore {
921921
const { recursive, dirty } = options || {};
922922

923923
this.getFieldEntities(true).forEach((field: FieldEntity) => {
924+
const fieldNamePath = field.getNamePath();
925+
924926
// Add field if not provide `nameList`
925927
if (!provideNameList) {
926-
namePathList.push(field.getNamePath());
928+
if (field.isList()) {
929+
if (namePathList.find(name => name.toString().includes(fieldNamePath.toString()))) {
930+
return;
931+
}
932+
}
933+
namePathList.push(fieldNamePath);
927934
}
928935

929936
// Skip if without rule
@@ -936,7 +943,6 @@ export class FormStore {
936943
return;
937944
}
938945

939-
const fieldNamePath = field.getNamePath();
940946
validateNamePathList.add(fieldNamePath.join(TMP_SPLIT));
941947

942948
// Add field validate rule in to promise list
@@ -1000,7 +1006,7 @@ export class FormStore {
10001006
const returnPromise: Promise<Store | ValidateErrorEntity | string[]> = summaryPromise
10011007
.then((): Promise<Store | string[]> => {
10021008
if (this.lastValidatePromise === summaryPromise) {
1003-
return Promise.resolve(this.getFieldsValue({ strict: true }));
1009+
return Promise.resolve(this.getFieldsValue(namePathList));
10041010
}
10051011
return Promise.reject<string[]>([]);
10061012
})

0 commit comments

Comments
 (0)