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

InternalError: too much recursion: access validation states from a validation #1222

Open
phlegx opened this issue Jan 30, 2024 · 1 comment

Comments

@phlegx
Copy link

phlegx commented Jan 30, 2024

Hi!

I use the latest version of vuelidate and I want to validate "required" if another attribute has validation state e.g. $invalid.

Options API example:

...
validations() {
  return {
    title: { minLength: ... },
    subtitle: {
      required: requiredIf((value, attributes) => {
        return this.v$.title.minLength.$invalid
      })
    } 
  }
}

I get InternalError: too much recursion when access this.v$.title. Any idea how I can solve this recursion?

@foodlz
Copy link

foodlz commented Mar 4, 2024

facing the same

validations () { return { user: { email: { email, isUnique(value) { if (value.trim().length === 0 || this.v$.user.email.email.$invalid) { return true } return false } }, } } },

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