i want to reset both value and validation.
i look up for some information, for example https://github.com/logaretm/vee-validate/issues/230
and i try to use errors.clear after setting the value to init one.
However it failed.
i try nextTick and requestAnimationFrame, it do not work.Only when i use setTimeout for more that 4 ms, it work.
so are there any reliable way to clear value and validation?
to reproduce.
you can enter the reset button.
here is the the reproduce link
https://codepen.io/toxic-johann/pen/wJGxEj
I will try to improve the update cycle of the plugin, there seem to be an issue with the update cycle handling.
$nextTick should be working fine after this commit https://github.com/logaretm/vee-validate/commit/82c24c2208a1311ce9fdc5aad7bdea11f549ba99
when will you publish this?
probably tomorrow if I didn't manage to squeeze more fixes.
@toxic-johann It is released:
thanks~
There seems to be an issue when using a validation delay : https://codepen.io/anon/pen/VpQPdZ
@Finrod927 I guess that is expected, since the value change occurs 500 after the errors have been reset, not sure if I can do anything about that.
Thanks for the quick answer, I must admit it makes senses.
Is it possible to modifiy the delay with an API?
I need to reset my form after submitting it. So I would reset it to 0 when submitting the form, and set it back to 500ms after the form is correctly submitted.
validateAll doesn't respect the delay, so you might use it to validate all fields immediately, changing the delays dynamically can be challenging atm, since I have to re-attach all listeners with the new delay value, definitely doable tho.
Ok thanks, I will check that
Most helpful comment
@toxic-johann It is released:
https://codepen.io/logaretm/pen/BWLQra