-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Initial errors are always set when using composition api & vuetify dialogs #4312
Comments
Not a bug this is intended. This is because errors in the form that predate the field being mounted are inherited by the field. vee-validate has no way to know if that field is going to be rendered or not. Your work around is correct so use it if it works for you. This came up a few times, perhaps this is something we need to change, like clear the error when a field is mounted. I need to think about it so I won't be closing this. |
Thanks for the fast response 🎉 |
We have a similar and probably related issue when using quasar dialogs. Reproduction:
Demo link: We downgraded to a previous version for now, but would be great if there would be some kind of solution for this use case without the workaround. Maybe also related to #4323 |
@robinpilz you didn't call |
@metalsadman I'm not sure how it exactly works under the hood, but for me it seems like when the fields get mounted, the errors for those fields are set even if the shared state did not have errors before and the fields were not even touched. Just feels kind of odd |
I think this line is causing the validation to fire when the form is getting mounted
|
@robinpilz Yep it feels odd now which is why I'm considering changing that behavior. @besrabasant That is correct, but the errors being placed for non-existent fields due to that silent validation is intended. The not intended part is errors inheriting their previous state before they were mounted, somewhere in |
What happened?
Hi, firstly thank you for making such a great vee-validate, really appreciate it!
I'm having an issue when using Composition API and opening a Vuetify dialog containing the form validations.
It's always has an initial error
Eamil is a required field
I've been trying for days in spare time to solve this issue without any result, I gave HOC a try, it's working but unfortunately it doesn't suit us for some reasons.Reproduction steps
Eamil is a required field
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
No response
Demo link
https://stackblitz.com/edit/vee-validate-issue-repproduction?file=src%2Fcomponents%2FDialog.vue
Code of Conduct
The text was updated successfully, but these errors were encountered: