Vee-validate: Fields are not updated with v-if

Created on 19 Oct 2018  ·  4Comments  ·  Source: logaretm/vee-validate

Versions

  • vee-validate: 2.1.0-beta.11 (also in old versions like 2.0.9)
  • vue: 2.5.17

Description
When a field is changed by other field, validations (errors and fields) are not updated

Step To Reproduce
With this jsfiddle

  1. Choose an input in the select component
  2. Write something in the input and remove it
  3. Choose other input in the select component
  4. The field is still the last input and the error is not cleared even resetting validations
duplicate ❔ question

Most helpful comment

Make sure you are adding key attribute to your inputs.

https://jsfiddle.net/rcs817x2/

This happens because of Vue's assumptions about your template which improves the performance, explained here

All 4 comments

Make sure you are adding key attribute to your inputs.

https://jsfiddle.net/rcs817x2/

This happens because of Vue's assumptions about your template which improves the performance, explained here

Thanks a lot!

Just stumbled across this and the solution - thanks!

Quick question - would it be possible to have the same behaviour as key for elements that have an id? This seems logical to me.

Key attributes is special to Vue rendering so it will be unlikely to
implement a custom solution for the id attr.

On Tue, 13 Nov 2018, 19:11 DM2489, notifications@github.com wrote:

Just stumbled across this and the solution - thanks!

Quick question - would it be possible to have the same behaviour as key
for elements that have an id?


You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/baianat/vee-validate/issues/1660#issuecomment-438353482,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-KSi5hGkDuPH1nFVG0luN3VlFURFhVks5uuv1TgaJpZM4Xwo0a
.

Was this page helpful?
0 / 5 - 0 ratings