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

ArrayFields are validated before touched

Open cwillinx opened this issue 1 year ago • 0 comments

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

  1. 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.
  2. Add the according arrayFields,
  3. 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

cwillinx avatar Aug 23 '24 09:08 cwillinx