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

$anyError should check $error on children instead of $anyDirty #315

Closed
Akryum opened this issue Jun 1, 2018 · 1 comment · Fixed by #316 or greenpeace/planet4-gpnl-plugin-gutenberg-blocks#4

Comments

@Akryum
Copy link
Contributor

Akryum commented Jun 1, 2018

Currently $anyError uses this expression according to the docs:

this.$anyDirty && !this.$pending && this.$invalid

This is wrong because a form can be $invalid and $anyDirty but not having any single $error in the validation tree.

For example, you only have required fields.

  1. The form is { $invalid: true, $anyDirty: false, $anyError: false } and no errors are displayed (yet)
  2. The user enter something in the first field, making it valid
  3. We touch the field so it becomes $dirty
  4. No error are show yet, because the other fields aren't $dirty (the user hasn't come to those yet)
  5. The form is now { $invalid: true, $anyDirty: true, $anyError: true }

It should be { $invalid: true, $anyDirty: true, $anyError: false } because we don't display any error.

This is very anoying if we want to disable the submit button as long as at least one error is shown.

Akryum added a commit to Akryum/vuelidate that referenced this issue Jun 1, 2018
@Akryum Akryum mentioned this issue Jun 1, 2018
@pareeohnos
Copy link

Any ETA on getting this merged? Running into this in our system and would like to get it finished up

pareeohnos added a commit to pareeohnos/vuelidate that referenced this issue Sep 3, 2018
Currently waiting on PR vuelidate#316 to be merged but need this fix now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants