svecosystem/formsnap

form-validation: add support to show only first error

vad99lord opened this issue · 1 comments

Right now form-validation shows all errors generated by Zod. Searching the docs I couldn't find any specific option in either zod or superform to adjust this behavior (early break on the first error for any field).

I think it could be useful to provide a prop that makes it possible to show only the first error, false by default, i.e.

<Form.Validation firstOnly />

Or maybe provide some callback function to transform errors for render

I like the idea of callback prop for transforming the errors! I'm going to be rewriting the internals quite a bit to support Superforms v2 so I'll add this to the roadmap!