Skip to content

issue: FormData returned by Form component lists fields that have been deleted #12291

@marcohamersma

Description

@marcohamersma

Version Number

7.53.0

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/damp-snow-td7pff

Steps to reproduce

  1. Create a form that uses useFieldArray, add some mockup fields as default values
  2. Call remove on one of the fields
  3. Submit the form using the new Form component
  4. The FormData still contains entries for the deleted form, just with its contents set to "undefined"

This might be related to some of the options I'm using in my code (e.g. keyName), so check out the codesandbox for that.

Expected behaviour

After removing a field, the previous field should no longer be present in the FormData

What browsers are you seeing the problem on?

Firefox

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions