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

:events['blur'] restricted provider triggered incorrectly with 'confirmed' rule #1869

Closed
c-kirkeby opened this issue Feb 19, 2019 · 0 comments · Fixed by #1915
Closed

:events['blur'] restricted provider triggered incorrectly with 'confirmed' rule #1869

c-kirkeby opened this issue Feb 19, 2019 · 0 comments · Fixed by #1915

Comments

@c-kirkeby
Copy link

Versions

  • vee-validate: 2.1.7
  • vue: 2.5.2

Describe the bug
The validation on a provider with a 'confirmed' rule is incorrectly being fired when the target has been entered into (even if it also has :events="['blur']"). This results in some aggressive inline errors where the confirmed field gets an error before it has even been focused. This can't be escaped with "bails=true" either.

To reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/embed/n5mnr9pq1j (this is a fork of the official Element UI example)
  2. Enter any value into the first 'Password' field
    At this point it'll trigger the 'required' rule from the 'Password confirmation' field.

Expected behavior
I would not expect a confirmed rule to be fired until all previous rules are satisfied if bails is true.

Demo link
As above.

Desktop (please complete the following information):

  • OS: Win 10
  • Browser Chrome
  • Version 72
logaretm added a commit that referenced this issue Mar 11, 2019
This PR forces the validation provider and the directive to not validate the cross-field targets until they have been interacted with or if validation was triggered manually at least once.

This solves the "aggressive" behavior when the user has only interacted with one of the two confirmed inputs for the first time.

closes #1902, closes #1869, closes #1765
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

Successfully merging a pull request may close this issue.

1 participant