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

Wrong formState reported when rendering only part of the form

Open
#168 10 comments 4 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**?

Bug report

### What is the current behavior?

In my use case I have multiple forms spread across multiple dashboard tabs because I want to render only the visible fields (form/active tab) for performance and code convenience reasons. Doing that way formState reports wrong value for **dirty** (and probably some more state props).

To reproduce:

1. https://codesandbox.io/s/98yk4xq814
2. Change the value in the field 'First name'. Submit button gets active because form is dirty.
3. Click 'toggle' button in the top left corner to show another "form". Submit button gets inactive even though the whole form is dirty.

### What is the expected behavior?

formState should be the same as if the whole form is rendered.

### Sandbox Link

https://codesandbox.io/s/98yk4xq814

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.