-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Validation breaks after unmounting of a duplicated field #3688
Comments
This is happening to me too due to animation. I have an animated transition in a wizard form between steps for entering single values and a final step where the user can review the entered values in a table. during the transition between the final step and the table, a duplicate of the field mounts before the field from the final step unmounts. |
* test(reduxForm): add failing test * test(reduxForm): fix failing test for validation after duplicate field unmount * fix #3688
Published fix in |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Are you submitting a bug report or a feature request?
This is a bug.
What is the current behavior?
When two fields for the same form value are rendered, then one of these fields is unmounted, validation stops to work.
For the provided sandbox:
In a more real-world scenario it occured to me when a part of the form was being re-rendered in a different branch of the DOM tree - 'new' fields get registered before old ones get unregistered, causing the error to occur.
What is the expected behavior?
Validation should work if there's a field rendered that requires it
Sandbox Link
https://www.webpackbin.com/bins/-L0ES7_aTU4kA-O9gsgc
What's your environment?
react 16,
redux-form 7.2.0
Other information
Probably need to check the count of the fields before removing the validators?
https://github.com/erikras/redux-form/blob/master/src/createReduxForm.js#L585
The text was updated successfully, but these errors were encountered: