React-final-form: Keys with empty values get deleted after edit, even with set defaultValues

Created on 12 Jun 2019  路  2Comments  路  Source: final-form/react-final-form

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

I have two input fields that start with empty strings as default values. Let's say the fields are edited and then reverted back to default (empty string). Now, the values object is missing that key.

What is the expected behavior?

I expect there to be a way for the values to remain empty.

Sandbox Link

Codesandbox Demo

What's your environment?

"react-final-form": @6.1.0,
"react-dom": @16.9.0,
"react": @16.9.0,
"final-form": @4.14.1

Most helpful comment

Using an identity parse function appears to be a good way to mitigate this. See https://github.com/final-form/react-final-form/issues/130#issuecomment-425482365

All 2 comments

Using an identity parse function appears to be a good way to mitigate this. See https://github.com/final-form/react-final-form/issues/130#issuecomment-425482365

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gsantiago picture gsantiago  路  5Comments

ThaNarie picture ThaNarie  路  3Comments

3dos picture 3dos  路  3Comments

niros-welldone picture niros-welldone  路  3Comments

LucienBouletRoblin picture LucienBouletRoblin  路  3Comments