SimpleForm's `keepDirtyOnReinitialize` prop should be `false` by default as `final-forms` does.
See original GitHub issueWhat you were expecting:
Hello, thanks for the great framework. Our team recently spent almost full 2-days to figure out why form.reset() doesn’t work for the dirty field. keepDirtyOnReinitialize property is documented as a false for its default value. However, in RA, it defaults to true going against the document of final-form (see https://final-form.org/docs/final-form/types/Config#keepdirtyonreinitialize). There is no special note about this property in RA’s document, so devs cannot expect this behavior at all.
What happened instead:
The property should have been false as the dependency (final-form) does. Or, at least, we should document this in RA’s document separately.
Steps to reproduce:
Related code:
- Preferably, a CodeSandbox forked from https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple
- A link to a GitHub repo with the minimal codebase to reproduce the issue
insert short code snippets here
Other information:
Environment
- React-admin version: 3.3.1
- Last version that did not exhibit the issue (if applicable):
- React version: 16.9.0
- Browser: N/A
- Stack trace (in case of a JS error): N/A
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Final Form Docs – `FormProps`
A predicate to determine whether or not the initialValues prop has changed, i.e. to know if the form needs to be reinitialized with...
Read more >Set initialValues from props, form state resets on props change
The problem is that when initialValues changes the entire form reinitialises. By default, whatever you pass to initialValues is compared against ...
Read more >reduxForm(config:Object)
When set to true , the form will reinitialize every time the initialValues prop changes. Defaults to false . If the keepDirtyOnReinitialize option...
Read more >Final Forms - Bemus Point Central School District
Final Forms. Maple Grove Athletic Department has partnered with FinalForms, an online form and data management service. FinalForms allows you to complete and ......
Read more >FinalForms: Boost Compliance & Safety
School District compliance starts here! Increase student safety and compliance. Reduce risk, controversy, and liability with FinalForms.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks for the issue.
@fzaninotto Thanks for the detailed response. Your answer was well delivered to my team. If you see this as a design choice, I can agree with the current implementation.
For your information, the example I referred to was from https://final-form.org/docs/react-final-form/examples/simple (with the ‘reset’ examples). The
final-formhas a decent set of examples for many uses cases. Despite the examples, I also agree thatfinal-formalso has issues, for example, removing keys with empty values (perhaps, this is the one you mentioned).Do you mind if I add some sentences to mitigate this possible confusion? I fully respect your decision, but still want to prevent some possible confusion. I already made a PR (https://github.com/marmelab/react-admin/pull/4260), so you can decide if your team accepts it 😃
Thanks for the great library. This helped our team to save resources significantly!