final-form / final-form

🏁 Framework agnostic, high performance, subscription-based form state management

Home Page:https://final-form.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

keepDirtyOnReinitialize can't handle undefined value

mjchang opened this issue · comments

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

@erikras Thanks for merging the fix. Any chance we can get a release?

Fix published in v4.20.7.