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

configure() doesnt work to turn off validateOnChange, validateOnInput, validateOnModelUpdate #4716

Closed
2 of 5 tasks
MickL opened this issue Mar 28, 2024 · 2 comments
Closed
2 of 5 tasks
Labels

Comments

@MickL
Copy link

MickL commented Mar 28, 2024

What happened?

Setting the values to false has no effect:

import { configure } from 'vee-validate';

configure({
  validateOnChange: false,
  validateOnInput: false,
  validateOnModelUpdate: false,
  validateOnBlur: false,
});

I would like to disable validation unless the submit button is pressed.

Reproduction

https://stackblitz.com/edit/github-x8muzj?file=app.vue

Version

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

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Code of Conduct

@vibonacci
Copy link

https://vee-validate.logaretm.com/v4/api/configuration#updating-the-config

As mentioned in the docs I linked at the tip on the bottom, the configure() only works if you use the VeeValidate Vue components.

It doesn't offer a solution, and I'm looking out for a solution as well to set those validateOn values all to false and only validate when submit is pressed.

@logaretm logaretm added the v5 label May 28, 2024
@logaretm
Copy link
Owner

Noted for v5, as it is related to #4630

Normalizing the validation triggers and error messages display to userland would make it easier to apply this change. As of now, the useXXX variants are assuming you will handle it yourself.

Alternatively, consider using defineField which does obey these configuration values if you use useField in the same component as your useForm call. It will be exposed as a public export in the next release.

@logaretm logaretm closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants