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

Form not dirty after removing items from FieldArray using final-form-arrays

Open
#1,038 2 comments 0 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?

I'm using react-final-form with final-form-arrays. I have a field array with a list of items, three items in the array. When I delete 2 out of 3 of the items, debug shows that the form is dirty and identifies the deleted items. Deleting the last item from the array shows the value of the array being empty ([]) however `dirty` being false, `dirtySinceLastSubmit` being false and`pristine` as true.

Am I missing something or should dirty remain true even if all items are deleted

### What is the expected behavior?
Form remains dirty when length of array differs from initial values?

### What's your environment?
"final-form": "^4.20.6",
"final-form-arrays": "^3.0.2"
"react-final-form": "^6.5.7"
"react-final-form-arrays": "^3.1.3"

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.