Open antoinerousseau opened 5 years ago
@erikras sorry to bother you but could you please have a quick look at this?
@antoinerousseau this could help for now https://github.com/final-form/final-form/issues/151#issuecomment-425867172
@sharpar works like a charm, thanks!
Are you submitting a bug report or a feature request?
feature request / bug report (could be either one depending on point of view...)
What is the current behavior?
I'm using
keepDirtyOnReinitialize
because some initial values are loaded asynchronously while the user could have already started to fill in the form. Once they submit it, I would like to reset the form to create a new entity (same page). Callingform.reset()
orform.initialize(initialValues)
has no effect.What is the expected behavior?
I think
form.reset()
should work wetherkeepDirtyOnReinitialize
is set or not. Otherwise maybe allow something likeform.reset(true)
orform.forceReset()
.Sandbox Link
https://codesandbox.io/s/react-final-form-keepdirtyonreinitialize-reset-4hnn7
What's your environment?
react-final-form@6.3.0 final-form@4.18.5 Chrome/macOS
Other information