-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Async validator on unregister set validating to true #780
Comments
This error appears when entering the step with the async validate:
|
I have the same issue |
@erikras any thoughts? |
I have the same issue either |
@erikras is there a workaround to avoid this behaviour? |
Not a great workaround (actually it's a terrible one 😃), but after the unregistering the field with a async validation we trigger |
Any new solutions ? |
Found a decent workaround in @alanpoulain's pull request
|
not work in normal component |
Inspired by this workaround, is using such a workaround: // use change to trigger final form to run validation again
function forceValidate(form: FormApi<any>) {
const randomName = 'a' + Math.random().toString(36).slice(2);
form.change(randomName, 'a');
form.change(randomName, undefined);
} |
Are you submitting a bug report or a feature request?
bug report
What is the current behavior?
On Wizard page we have a step with a field, that has async validator.
After going to next step, the field is unregistered and a new field is registered with a not-async validator.
However, the
validating
is set totrue
when entering the step and after it's changed tofalse
, theFormSpy
component is not updated and re-rendered. So, the next button remains disabled.This behavior was introduced in #766
What is the expected behavior?
When
validating
is set tofalse
, re-renderFormSpy
Sandbox Link
https://codesandbox.io/s/react-final-form-simple-example-0rc9g?fontsize=14&hidenavigation=1&theme=dark
Code
### code
What's your environment?
Node v10.16.0
Issue
data-driven-forms/react-forms#431
cc @Hyperkid123
The text was updated successfully, but these errors were encountered: