[Bug]: Only the first error is reported in an object with multiple zfd.text
fields
#349
Closed
1 of 4 tasks
Labels
bug
Something isn't working
Which packages are impacted?
remix-validated-form
@remix-validated-form/with-zod
@remix-validated-form/with-yup
zod-form-data
What version of these packages are you using?
zod-form-data
: 2.0.2zod
: 3.22.4Please provide a link to a minimal reproduction of the issue.
https://codesandbox.io/p/sandbox/zod-form-data-text-bug-repro-swh7j3?file=%2Fsrc%2Findex.ts
Steps to Reproduce the Bug or Issue
zfd.text()
helper for multiple fields in az.object
Expected behavior
Get a "Required" error on all the fields
Screenshots or Videos
No response
Platform
N/A
Additional context
I would expect these two schemas to be equivalent:
However, when validating the data
{ "foo": "", "bar": "" }
, the former correctly produces errors on all three fields. The latter only produces an error for the first field.The text was updated successfully, but these errors were encountered: