-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Initial Value for a field is set again even if the value for that field has been changed to something else. #536
Comments
I second your opinion on the expected behaviour, WorkaroundTry using |
@ndrsllwngr I can use the hooks solution because I am using classes in my react component. I will have to rewrite the entire thing and learn hooks. :/ |
You should be able to implement similar logic based on |
@Andarist can you please elaborate on this? |
@Andarist I tried many hacks with FormSpy, not able to make even a single one work. Help would be appreciated, as we are using react-final-forms in couple of places and I love using the library. Somehow, the initialValue seems to cause a trouble in other cases as well. Like in other place if I set field level initialValue( |
@erikras can you help? |
Fix published in |
bug report
What is the current behavior?
I am using wizrard form. The form in total has three pages. On the basis of field values of the first page, second page field values are generated from an API request. We are sending some default values from our backend and I am setting the initialValue for the field. Everything works fine for the first time but as soon as I navigate to third page and come back to the second page, whatever change I have made to the field values are lost and the fields take up the initial values.
What is the expected behavior?
The field should retain the changed values.
Second page fields
What's your environment?
🏁 React Final Form version 6.1.0
🏁 Final Form version 4.13.1
OS/browser affected Mojave/Chrome
React 16.8.6
The text was updated successfully, but these errors were encountered: