vee-validate icon indicating copy to clipboard operation
vee-validate copied to clipboard

keepValuesOnUnmount not being respected using useField

Open hahagu opened this issue 1 year ago • 0 comments

What happened?

When using useField, keepValuesOnUnmount should keep the field values. However, this does not seem to be happening, as my custom field seems to reset every time it is mounted. How does one go about solving this issue? I've made a reproduction demo below.

Reproduction steps

  1. turn on keepValuesOnUnmount in useForm
  2. use useField to create a custom field
  3. unmount
  4. remount (with the demo, next button, and then prev button should do it)
  5. values are gone

Version

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

What browsers are you seeing the problem on?

  • [ ] Firefox
  • [X] Chrome
  • [ ] Safari
  • [ ] Microsoft Edge

Relevant log output

No response

Demo link

https://stackblitz.com/edit/vee-validate-v4-multi-step-form-composition-omhvva?file=src%2FApp.vue

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

hahagu avatar Aug 02 '24 08:08 hahagu