File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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' ;
32import warning from '@rc-component/util/lib/warning' ;
43import * as React from 'react' ;
54import { HOOK_MARK } from '../FieldContext' ;
@@ -779,14 +778,9 @@ export class FormStore {
779778 const { onValuesChange } = this . callbacks ;
780779
781780 if ( onValuesChange ) {
782- const fieldEntity = this . getFieldsMap ( true ) . get ( namePath ) ;
783781 const changedValues = cloneByNamePathList ( this . store , [ namePath ] ) ;
784782 const allValues = this . getFieldsValue ( ) ;
785- // Merge changedValues into allValues to ensure allValues contains the latest changes
786- const mergedAllValues = mergeWith ( [ allValues , changedValues ] , {
787- // When value is array, it means trigger by Form.List which should replace directly
788- prepareArray : current => ( fieldEntity ?. isList ( ) ? [ ] : [ ...( current || [ ] ) ] ) ,
789- } ) ;
783+ const mergedAllValues = setValue ( allValues , namePath , getValue ( changedValues , namePath ) ) ;
790784 onValuesChange ( changedValues , mergedAllValues ) ;
791785 }
792786
You can’t perform that action at this time.
0 commit comments