Skip to content

Commit 7ffbcb0

Browse files
committed
feat: review
1 parent a43a38a commit 7ffbcb0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/useForm.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,8 @@ export class FormStore {
911911
? nameList.map(getNamePath)
912912
: [];
913913

914+
const removeListNameStrList: string[] = [];
915+
914916
// Collect result in promise list
915917
const promiseList: Promise<FieldError>[] = [];
916918

@@ -926,7 +928,7 @@ export class FormStore {
926928
// Add field if not provide `nameList`
927929
if (!provideNameList) {
928930
if (field.isList() && namePathList.some(name => matchNamePath(name, fieldNamePath, true))) {
929-
return;
931+
removeListNameStrList.push(fieldNamePath.toString());
930932
}
931933
namePathList.push(fieldNamePath);
932934
}
@@ -1004,7 +1006,10 @@ export class FormStore {
10041006
const returnPromise: Promise<Store | ValidateErrorEntity | string[]> = summaryPromise
10051007
.then((): Promise<Store | string[]> => {
10061008
if (this.lastValidatePromise === summaryPromise) {
1007-
return Promise.resolve(this.getFieldsValue(namePathList));
1009+
const filterListNameList = namePathList.filter(
1010+
name => !removeListNameStrList.some(nameStr => nameStr === name.toString()),
1011+
);
1012+
return Promise.resolve(this.getFieldsValue(filterListNameList));
10081013
}
10091014
return Promise.reject<string[]>([]);
10101015
})

0 commit comments

Comments
 (0)