Closed pavelrotek closed 1 month ago
Please share your schema with me. You can also use our playground if you like: https://valibot.dev/playground/
See the example. I'd expect... if forward method has array as second argument then multiple props are possible. Typescript gives the error. Multiple props works somehow, but path in returned issues is different for password2 and password1.
Is your goal to display the error message on both fields? This requires adding forward
and check
twice for each field
I recommend to just forward the error message to password2
and specify in the error message that both entries do not match.
yes, sure... But my question is rather from API design point of view... If it is not intended to use forward with multiple fields, why the array is used? Just simple field is enough.
To forward issues to deeply nested fields. Have a look at this playground.
Aaaa, ok, sorry for the question. My fault. it is clear now. closing
Hello Fabian,
according to forward method signature one would expect, that multiple fields can be used in pathList argument. But typescript doesn't allow that. I'd expect in this case that error will be forwarded to all fields listed in pathList.
Kind regards,
Pavel