File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 5050 },
5151 "dependencies" : {
5252 "@rc-component/async-validator" : " ^5.0.3" ,
53- "@rc-component/util" : " ^1.3 .0" ,
53+ "@rc-component/util" : " ^1.5 .0" ,
5454 "clsx" : " ^2.1.1"
5555 },
5656 "devDependencies" : {
Original file line number Diff line number Diff line change 11import { merge } from '@rc-component/util/lib/utils/set' ;
2+ import { mergeWith } from '@rc-component/util' ;
23import warning from '@rc-component/util/lib/warning' ;
34import * as React from 'react' ;
45import { HOOK_MARK } from './FieldContext' ;
@@ -786,7 +787,10 @@ export class FormStore {
786787 const changedValues = cloneByNamePathList ( this . store , [ namePath ] ) ;
787788 const allValues = this . getFieldsValue ( ) ;
788789 // Merge changedValues into allValues to ensure allValues contains the latest changes
789- const mergedAllValues = merge ( allValues , changedValues ) ;
790+ const mergedAllValues = mergeWith ( [ allValues , changedValues ] , {
791+ // When value is array, it means trigger by Form.List which should replace directly
792+ prepareArray : current => ( Array . isArray ( value ) ? [ ] : [ ...( current || [ ] ) ] ) ,
793+ } ) ;
790794 onValuesChange ( changedValues , mergedAllValues ) ;
791795 }
792796
You can’t perform that action at this time.
0 commit comments