-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validating with Zod not applying the .transform()
method for useField()
#4713
Labels
🛳 In PR
This issue is being addressed in a PR
Comments
This was referenced Jun 26, 2024
This was referenced Sep 12, 2024
This was referenced Sep 20, 2024
This was referenced Oct 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: