New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validate does not trigger with new initialValues #4782
Comments
I also encountered this bug. |
Confirming bug. Validation errors are kept between |
I get this to. Anyone who have an workaround? |
@Sojborg Only with patching a single line of code with --- a/node_modules/redux-form/es/createReduxForm.js
+++ b/node_modules/redux-form/es/createReduxForm.js
@@ -138,7 +138,7 @@ export default function createReduxForm(structure) {
updateUnregisteredFields: nextProps.updateUnregisteredFields
});
- return true;
+ return false;
}
} else if (_this.props.initialValues && (!_this.props.initialized || enableReinitialize)) {
_this.props.initialize(_this.props.initialValues, _this.props.keepDirtyOnReinitialize, {
|
Thanks @cpof-tea! Did you try to make a PR with this change? |
@Sojborg Actually, I don't have time to check if the original behavior is intended or a bug. Also, I can't say if this patch can break something or not |
Hi, does anyone encountered any issue using this patch ? |
@pnogier I'm using it and it works in my project and I'm using it in a larger company app with multiple forms with many form elements. |
@Sojborg I will open a PR in a few days then |
When the form is passed a new initialValues prop the validate function does not fire.
This happens with redux-form 8.3.10 but not on 8.3.9 or below.
On initial load of the form the validate function fires as expected. Upon passing the form a new initialValues prop, validate does not fire as I would expect.
The text was updated successfully, but these errors were encountered: