kazupon / vue-validator

:white_check_mark: Validator component for Vue.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot clear rules dynamically

dragantl opened this issue · comments

commented

vue & vue-validator version

1.0.28, 2.1.6

Reproduction Link

https://jsfiddle.net/ek3nffcd/5/

Steps to reproduce

  1. Enter text into bar to remove it as an error factor (added 2nd filed to have at least one validation present)
  2. Note that foo is not required when run initially
  3. Check the checkbox
  4. foo is now required
  5. Un-check the checkbox
  6. Foo is still required
  7. Enter text into foo
  8. Check the checkbox
  9. Remove text from foo
  10. Un-check the checkbox

What is Expected?

After step 4, I expect form to become valid because foo is no longer required
After step 6, I would expect some change... seems validation doesn't occur at all
After step 9, I again expect the form to be valid

What is actually happening?

It seems that the removal of validation does nothing. In my project, I want to toggle a checkbox that would add/remove validation from certail fieldset while making that fieldset disabled (not hiding it). However, when fields are enabled, there is no way to remove their validation requirement afterwards.