You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the .transform() method to edit the data to be sent to the form submit function.
It works well for fields declared with defineField() method but not for custom inputs / fields declared with useField() method.
In the second case, the value is submitted without being transformed, even though it is being validated. Neither the transform() function nor the zod string transformations ( like toUppoerCase() ) work.
Reproduction steps
Create a custom input component using useField() with a Zod validation schema
Use it in a form context
Type a valid value and submit
The value is correctly validated but not transformed
What happened?
I'm using the
.transform()
method to edit the data to be sent to the form submit function.It works well for fields declared with
defineField()
method but not for custom inputs / fields declared withuseField()
method.In the second case, the value is submitted without being transformed, even though it is being validated. Neither the
transform()
function nor the zod string transformations ( liketoUppoerCase()
) work.Reproduction steps
useField()
with a Zod validation schema!!! I have note tested for Safari
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
No response
Demo link
https://stackblitz.com/edit/vitejs-vite-mrsjdx?file=src%2FApp.vue,src%2Fcomponents%2FForm1.vue,src%2Fcomponents%2FForm2.vue,src%2Fcomponents%2FInputText.vue&terminal=dev
Code of Conduct
The text was updated successfully, but these errors were encountered: