keepDirtyOnReinitialize can't handle undefined value
mjchang opened this issue · comments
Michael Chang commented
Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
If keepDirtyOnReinitialize
is true, when a field is changed from its initial value to undefined, the initialize logic will set formState.values to undefined which causes the form to crash.
What is the expected behavior?
formState.values
should never become undefined. If a field's value is changed to undefined, the key should be removed from formState.values
.
Sandbox Link
What's your environment?
final-form 4.20.6
react-final-form 6.5.8
node 16
Other information
Michael Chang commented
@erikras Thanks for merging the fix. Any chance we can get a release?
Erik Rasmussen commented
Fix published in v4.20.7
.