Closed kettanaito closed 5 years ago
https://github.com/kettanaito/react-advanced-form/blob/9c17655af6add48eeb901f25b0350055f438e2bb/src/utils/handlers/handleFieldChange.js#L35-L47
This returns anything controlled change handler returns (i.e. async action). Later, depending on the returned payload from the handleFieldChange handler, Form.handleFieldChange dispatches its updateFieldWith.
handleFieldChange
Form.handleFieldChange
updateFieldWith
https://github.com/kettanaito/react-advanced-form/blob/9c17655af6add48eeb901f25b0350055f438e2bb/src/components/Form.jsx#L452-L454
This results into returned payload set as the field's state, which is wrong.
onChange
Environment
What
Current behavior
https://github.com/kettanaito/react-advanced-form/blob/9c17655af6add48eeb901f25b0350055f438e2bb/src/utils/handlers/handleFieldChange.js#L35-L47
This returns anything controlled change handler returns (i.e. async action). Later, depending on the returned payload from the
handleFieldChange
handler,Form.handleFieldChange
dispatches itsupdateFieldWith
.https://github.com/kettanaito/react-advanced-form/blob/9c17655af6add48eeb901f25b0350055f438e2bb/src/components/Form.jsx#L452-L454
This results into returned payload set as the field's state, which is wrong.
Expected behavior
How
onChange
handler first, then return short-circuit