Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide a full working example #147

Open
OnkelTem opened this issue Aug 28, 2020 · 1 comment
Open

Please provide a full working example #147

OnkelTem opened this issue Aug 28, 2020 · 1 comment

Comments

@OnkelTem
Copy link

OnkelTem commented Aug 28, 2020

Are you submitting a bug report or a feature request?

Documentation request.

What is the current behavior?

Currently it's not clear how to build a form with a set of array elements, which correctly tracks statuses of the fields.
The example provided in the readme just skips this problem.

Here is an updated version of the readme's example: https://codesandbox.io/s/react-final-form-field-arrays-forked-jriin?file=/index.js

As you can see, deleting a row makes the others 'dirty'.

What is the expected behavior?

A working example to show how to properly use the component.

For example, an array of three elements ['a', 'b', 'c'] being updated by removing the first element 'a', is treated as being actually updated in a different way:

  • the last element was removed
  • the first two were updated.

It seems like the following bug reports describe similar problem in different ways:

#145
#37
#36
#34
#33

So what is the proper way of using FieldArray?

Sandbox Link

https://codesandbox.io/s/react-final-form-field-arrays-forked-jriin?file=/index.js

What's your environment?

See the sandbox.

@ddzieduch
Copy link

ddzieduch commented Aug 20, 2024

I think this is also related #107 and #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants