From d1da4bad30b56e9e0f62eb9bcd8699ec78049371 Mon Sep 17 00:00:00 2001 From: shaodahong <darryshaw@gmail.com> Date: Fri, 13 Nov 2020 10:12:13 +0800 Subject: [PATCH] fix: Form change trigger --- components/form/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/form/index.tsx b/components/form/index.tsx index 30a2952..bb1efac 100644 --- a/components/form/index.tsx +++ b/components/form/index.tsx @@ -145,7 +145,7 @@ const InternalForm: ForwardRefRenderFunction<FormInstance, FormProps> = ( layoutCol = { span: 24 }, initialValues: initialValuesInternal, placeholder: placeholderInternal = '-', - onValuesChange: onValuesChangeInternal, + onFieldsChange: onFieldsChangeInternal, mode, cardProps, childrenProps, @@ -341,10 +341,10 @@ const InternalForm: ForwardRefRenderFunction<FormInstance, FormProps> = ( ) } - const onValuesChange = (changeValues: Store, values: Store) => { + const onFieldsChange = (changedFields: any[], allFields: any[]) => { forceUpdate() - isFunc(onValuesChangeInternal) && - onValuesChangeInternal(changeValues, values) + isFunc(onFieldsChangeInternal) && + onFieldsChangeInternal(changedFields, allFields) } const FormChildren = ( @@ -372,7 +372,7 @@ const InternalForm: ForwardRefRenderFunction<FormInstance, FormProps> = ( form={formInsatce} onFinish={onFinish} onReset={onReset} - onValuesChange={onValuesChange} + onFieldsChange={onFieldsChange} initialValues={initialStates.initialValues} {...props} >