Skip to content

initial-values + zod validation-schema behaves strangely in multi-step form #4997

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

Open
2 of 5 tasks
RossLote opened this issue Mar 4, 2025 · 0 comments
Open
2 of 5 tasks

Comments

@RossLote
Copy link

RossLote commented Mar 4, 2025

What happened?

I have this example using yup: https://stackblitz.com/edit/vee-validate-v4-hoc-multi-step-form-eky2u2as?file=src%2FApp.vue

And this using zod: https://stackblitz.com/edit/vee-validate-v4-hoc-multi-step-form-meu1mnvu?file=src%2FApp.vue

You will see that both examples are exactly the same. However the value for the zod example only contains the values in the first step but the yup one contains all values.

Zod is the validation tool I'm using in my project

Locally I have had varying behaviour. With some form configurations the value contains all of the initial values and other only the values from the first step. I can't figure out the specifics but managed to get this example to reproduce it.

What's even stranger, if you look here: https://stackblitz.com/edit/vee-validate-v4-hoc-multi-step-form-trxfzvpx?file=src%2FApp.vue I have just nulled one of the fields in the initial values in step 1 and now it shows all values.

Reproduction steps

As above

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Relevant log output

Demo link

As above

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant