Skip to content

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

@RossLote

Description

@RossLote

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions