Closed
Description
Are you submitting a bug report or a feature request?
I believe this is a bug.
What is the current behavior?
Here is a version of of the React Final Form Arrays example, modified to have validation errors that only appear when a field has been touched:
https://codesandbox.io/s/8k623wrrz9
- Click "Add Customer"
- Click in the "First Name" field, type something in (ex. "Homer")
- Click in the "Last Name" field, but do not type in it
- Click "Add Customer" again (Red text "Required" will appear under Customer 1's Last Name)
- Click in Customer 2's "First Name" field, type something different (ex. "Marge")
- Do not click in Customer 2's "Last Name" field.
- Click the "Swap first two" button
The names have changed, but the "Required" error message is still in the same place (or, depending on your perspective, has moved to a different customer).
What is the expected behavior?
I would expect the "touched" state to move along with the field, so that in this example the error would still be attached to Homer's last name, even though Homer has moved.
What's your environment?
- final-form-arrays@1.0.4
- final-form@4.8.2
- react-final-form@3.6.2
- Chrome 67.0.3396.99
- macOS Sierra (10.12.6)
Other information
The demo shows this happening with swap
, but I originally observed the behavior with move
.
Metadata
Metadata
Assignees
Labels
No labels