Open senwong opened 3 years ago
codesandbox demo
I want use form.getFieldsValue function in onValuesChange callback. But When typing in the input element,form.getFieldsValue can not get the value.
But when changing field value by form.setFieldsValue function, in onValuesChange callback can get field value. Is this by design?
In createBaseForm.js in this.setFieldsValue function, onValuesChange callback is invoked after this.setFields. https://github.com/react-component/form/blob/f02b478c59c178ea9ee28cca3326ad1c4ed37f02/src/createBaseForm.js#L370
But in this.onCollect function, onValuesChange callback is invoked before this.setFields. Is this by design? https://github.com/react-component/form/blob/f02b478c59c178ea9ee28cca3326ad1c4ed37f02/src/createBaseForm.js#L133
codesandbox demo
I want use form.getFieldsValue function in onValuesChange callback. But When typing in the input element,form.getFieldsValue can not get the value.
But when changing field value by form.setFieldsValue function, in onValuesChange callback can get field value. Is this by design?
In createBaseForm.js in this.setFieldsValue function, onValuesChange callback is invoked after this.setFields. https://github.com/react-component/form/blob/f02b478c59c178ea9ee28cca3326ad1c4ed37f02/src/createBaseForm.js#L370
But in this.onCollect function, onValuesChange callback is invoked before this.setFields. Is this by design? https://github.com/react-component/form/blob/f02b478c59c178ea9ee28cca3326ad1c4ed37f02/src/createBaseForm.js#L133