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

[v4] Errors continue to exist when deleting an item #3664

Closed
5 tasks done
simirka opened this issue Jan 21, 2022 · 2 comments
Closed
5 tasks done

[v4] Errors continue to exist when deleting an item #3664

simirka opened this issue Jan 21, 2022 · 2 comments
Labels
🐛 bug Unintended behavior

Comments

@simirka
Copy link

simirka commented Jan 21, 2022

What happened?

When you remove an item from the field array, errors still exist in the errors object, they should be reindexed according to the current field's value. It`s a big problem because when you will remove and push again errors will be displayed on the new item.
image

When I will press Add button my new item with index 1 will have an error.

Reproduction steps

  1. Create an FieldArray and add basic actions push, remove
  2. Add displaying errors from the form
  3. Start removing items from fields and check errors displaying

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Relevant log output

No response

Demo link

https://codesandbox.io/s/vee-validate-v4-repeater-d9qft?file=/src/App.vue

Code of Conduct

@logaretm logaretm added the 🐛 bug Unintended behavior label Jan 23, 2022
@logaretm
Copy link
Owner

logaretm commented Jan 23, 2022

Looks like this happens when you use rules on individual fields and you remove fields from the middle of the list. This was caused by the field not unsettling the old errors path.

Should be up shortly in a new patch release. Thank you for reporting this.

@simirka
Copy link
Author

simirka commented Jan 24, 2022

@logaretm
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants