final-form / final-form/react-final-form

Empty form values are not included on submit

Open
#430 7 comments 30 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

### Are you submitting a **bug report** or a **feature request**?

Maybe it is a feature, but I consider it a bug.

### What is the current behavior?

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


...

// result
{
}

### What is the expected behavior?

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: ""
}

### Sandbox Link

Upon opening the sandbox, press "SUBMIT" without entering anything.
https://codesandbox.io/s/z66380078l

### What's your environment?

### Other information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.