airjp73 / rvf

Easy form validation and state management for React and Remix
https://rvf-js.io
MIT License
827 stars 66 forks source link

[Bug]: FieldArray 'replace' function sets field value as error message, causing false error display for inputs #308

Closed andriialbatov closed 1 month ago

andriialbatov commented 1 year ago

Which packages are impacted?

What version of these packages are you using?

"@remix-validated-form/with-zod": "2.0.6", "remix-validated-form": "5.0.2",

Please provide a link to a minimal reproduction of the issue.

https://codesandbox.io/p/sandbox/billowing-lake-ff9gq9?file=%2Fapp%2Froutes%2Findex.tsx%3A84%2C10-84%2C20

Steps to Reproduce the Bug or Issue

In the demo

  1. Click on "Replace", which uses FieldArray 'replace' function and you will see errors in the input fields which was replaced

Expected behavior

No error messages on inputs

Screenshots or Videos

No response

Platform

macos latest firefox and chrome

Additional context

No response

airjp73 commented 1 year ago

Yep, looks like the logic for replace is incorrect. Will look into it.

airjp73 commented 1 month ago

RVF v6 has been released 🎉

This should no longer be a problem in v6. If it's still a problem in that version, please feel free to open a new issue.

You can find the documentation here and the migration guide here.