Maybe it is a feature, but I consider it a bug.
Empty form values and pre-selected options are not included in the submit result.
Related issue https://github.com/final-form/react-final-form/issues/327
<Field name="favoriteColor" component="select">...</Field>
<Field name="description" component="input" />
// result
{
}
Expected is that every named field has a value in the result.
// this is the result of direct DOM access to form.elements
{
favoriteColor: "#ABC",
description: ""
}
Upon opening the sandbox, press "SUBMIT" without entering anything.
https://codesandbox.io/s/z66380078l
This looks related to #130
Any updates here?
Would it make sense to merge the actual final-form values to form.elements so that the empty (default) fields are persisted?
It also prevents validation, the validation function passed to useField is not executed
Most helpful comment
This looks related to #130