-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Conditional rendering a component that handle validation logic breaks "Save" #6049
Comments
I'm experiencing the same issue. |
Thanks for the report. I understand it's a react-final-form bug that needs to be fixed upstream. I'll keep this issue open until final-form/react-final-form#899 is merged and released. |
Just do add in case you find it useful, I have followed provided earlier advice to work around this issue. I have added array mutators to my custom mutators, and also added https://github.com/ignatevdev/final-form-submit-errors in the list of mutators. That fixes an issue with the form not being able to open. Forms in my application now open, but the validation appears to be running forever so the save button never actually closes and saves the form. It also completely locks the application from responding to any clicks on menus or anywhere else. |
I have related issue `
` Having full form with data and then disabling
Snippet used to work. |
The faulty code in final-form.js:597 is only reached when validator return a Promise. |
I create a repro here:
https://github.com/andrico1234/react-admin/tree/bug/validating-repro
It appears that with a new version of
react-final-form
there's a bug that causes this error:Cannot set property 'validating' of undefined
More details can be found here:
final-form/react-final-form#899
I managed to replicate it in React Admin. If you run the simple demo and navigate to a
PostEdit
page.It seems that if you hide a conditionall rendered component, then save,
react-final-form
gets itself in a jam.AFAIK, this doesn't happen with all validators, but breaks when using the
minValue
validator.Here's a video of it in action
ra-bug.mov
The text was updated successfully, but these errors were encountered: