vee-validate
vee-validate copied to clipboard
ArrayFields are validated before touched
What happened?
When using ArrayFields, validation errors are set during setup, before any user interaction or validation triggered. This behaviour is different than on regular fields.
Expected behaviour: the same as with regular fields, no errors are set before any user interaction on pristine forms. Actual behaviour: ArrayFields' error object contains errors. Resetting the form doesn't remove the errors.
Reproduction steps
- Set up a form with useForm, add yup as validation scheme. Set initial data in a way, that one entry is valid, the other not.
- Add the according arrayFields,
- run the project, the invalid array filed will contain an error message, the invalid regular field and the valid array field not.
See the demo code here: https://github.com/cwillinx/vee-validate-v4-prime-vue-arrayfield-test And the demo: https://stackblitz.com/~/github.com/cwillinx/vee-validate-v4-prime-vue-arrayfield-test?file=src/App.vue
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
- [ ] Firefox
- [X] Chrome
- [X] Safari
- [ ] Microsoft Edge
Relevant log output
No response
Demo link
https://stackblitz.com/~/github.com/cwillinx/vee-validate-v4-prime-vue-arrayfield-test?file=src/App.vue
Code of Conduct
- [X] I agree to follow this project's Code of Conduct