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

Force resetting a form should also force reset initial values instead of merging #4729

Open
5 tasks done
robinpilz opened this issue Apr 16, 2024 · 0 comments
Open
5 tasks done

Comments

@robinpilz
Copy link

What happened?

Calling resetForm with force: true does still merge the initial values. In my opinion it should also force reset the initial values.
Currently this leads to a bug where when you reset the form based on a watcher and the new values have fewer entries the initial values still contain the properties only the previous values had.

Probably inside the resetForm function the force option would need to be passed to the setInitialValues function and then not merge the values if the option is true

Reproduction steps

  1. Click "Add"
  2. initialValues has "test" property
  3. Click "Change entity"
  4. initialValues still has "test" property despite not being present in "bar" entity and using resetForm with force option

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/vee-validate-v4-quasar-framework-zrojtm?file=src%2FApp.vue,src%2FEditDialog.vue,src%2FInputWithValidation.vue

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