Vee-validate: $validator.validateAll() marks clean fields as dirty

Created on 13 Mar 2017  Â·  3Comments  Â·  Source: logaretm/vee-validate

Versions:

  • VueJs: 2.2.1
  • Vee-Validate: 2.0.0-beta.22

Description:

Calling $validator.validateAll() marks clean fields as dirty

Steps To Reproduce:

console.info(this.$validator.fieldBag.dirty()) // false
$validator.validateAll() // no errors
console.info(this.$validator.fieldBag.dirty()) // true

✨ enhancement

Most helpful comment

This is now fixed, flags and classes have their own event cycles. should be up in the next release.

All 3 comments

I just ran into this too. Using vue-router, it doesn't look like there is any way to get vee-validate to automatically validate fields when the routed component is mounted. I had to manually call validateAll() in the mounted hook and now my untouched fields are all marked dirty. Is there any way to get vee-validate to play nice with vue-router so I don't have to do this?

Currently, the validator doesn't use proper listeners for the flags, I hope to fix this sometime next week.

This is now fixed, flags and classes have their own event cycles. should be up in the next release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MeltedFreddo picture MeltedFreddo  Â·  3Comments

Etheryte picture Etheryte  Â·  3Comments

HunterJS-bit picture HunterJS-bit  Â·  3Comments

yyyuuu777 picture yyyuuu777  Â·  3Comments

triffer picture triffer  Â·  3Comments