Skip to content
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

useFieldArray's resetForm with initial values from a Pinia store syncs values back to the store when it shouldn't #4536

Closed
2 of 5 tasks
mixmav opened this issue Nov 10, 2023 · 2 comments

Comments

@mixmav
Copy link

mixmav commented Nov 10, 2023

What happened?

The local push method from useFieldArray on a form with resetForm applied with initial values from a Pinia Store incorrectly add the value back to the store when changed locally.

Reproduction steps

  1. Using useForm, create a useFiledArray field
  2. Reset the array field from a Pinia Store
  3. Push to the field
  4. Notice how the store is updated on the first push ❗
    ...

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

No response

Demo link

https://stackblitz.com/edit/vitejs-vite-xkkkpv?file=src%2FApp.vue

Code of Conduct

@mixmav
Copy link
Author

mixmav commented Nov 13, 2023

@logaretm this seems like a bug; do you mind taking a look 🧪

@logaretm
Copy link
Owner

Thank you for reporting this, this is fixed and should be up in the next release.

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

2 participants