Skip to content

Object key gets removed after removing last item in field array #95

Open
@erickjth

Description

@erickjth

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

Currently, when adding an item into an array key, and then removing the last one, the key gets removed from the original object, no matter if the key was initialized as an empty array.

What is the expected behavior?

Keep the key in the form values, as an empty array.

Sandbox Link

https://codesandbox.io/s/react-final-form-field-arrays-forked-xopb2v

What's your environment?

"final-form": "4.20.9",
"final-form-arrays": "3.1.0",
"react": "17.0.0",
"react-dom": "17.0.0",
"react-final-form": "6.5.9",
"react-final-form-arrays": "3.1.3",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions