@@ -910,8 +910,7 @@ export class FormStore {
910
910
const namePathList : InternalNamePath [ ] | undefined = provideNameList
911
911
? nameList . map ( getNamePath )
912
912
: [ ] ;
913
-
914
- const removeListNameStrList : string [ ] = [ ] ;
913
+ const noListNamePathList = [ ...namePathList ] ;
915
914
916
915
// Collect result in promise list
917
916
const promiseList : Promise < FieldError > [ ] = [ ] ;
@@ -927,8 +926,11 @@ export class FormStore {
927
926
928
927
// Add field if not provide `nameList`
929
928
if ( ! provideNameList ) {
930
- if ( field . isList ( ) && namePathList . some ( name => matchNamePath ( name , fieldNamePath , true ) ) ) {
931
- removeListNameStrList . push ( fieldNamePath . toString ( ) ) ;
929
+ if (
930
+ // When Form.List has a value, filter Form.List `name`
931
+ ! ( field . isList ( ) && namePathList . some ( name => matchNamePath ( name , fieldNamePath , true ) ) )
932
+ ) {
933
+ noListNamePathList . push ( fieldNamePath ) ;
932
934
}
933
935
namePathList . push ( fieldNamePath ) ;
934
936
}
@@ -1006,10 +1008,7 @@ export class FormStore {
1006
1008
const returnPromise : Promise < Store | ValidateErrorEntity | string [ ] > = summaryPromise
1007
1009
. then ( ( ) : Promise < Store | string [ ] > => {
1008
1010
if ( this . lastValidatePromise === summaryPromise ) {
1009
- const filterListNameList = namePathList . filter (
1010
- name => ! removeListNameStrList . some ( nameStr => nameStr === name . toString ( ) ) ,
1011
- ) ;
1012
- return Promise . resolve ( this . getFieldsValue ( filterListNameList ) ) ;
1011
+ return Promise . resolve ( this . getFieldsValue ( noListNamePathList ) ) ;
1013
1012
}
1014
1013
return Promise . reject < string [ ] > ( [ ] ) ;
1015
1014
} )
0 commit comments