-
-
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
4.12.x doesn't produce errorMessage from useField in some cases if multiple useFields are used with same name. #4609
Comments
Previously, multiple fields could share the same name given they represent the same field. However that caused a lot of issues when those fields get mounted/unmounted as they override one another #4476 #4557 (f688896). I see you were just interested in the You can use
Passing Here is the example with the fixes, i removed The multiple field support was a side effect of a refactor done between A general rule of thumb here is |
Thank you, that solved the problem for us. 👍 |
@logaretm Sorry for posting in my closed issue. But it is, at least to some extent, a follow-up so I thought I could maybe post it here. |
What happened?
We use custom components for radio buttons and radio button groups.
In the radio button group component we wrap a set of radio buttons in a fieldset and show the potential error message for the group.
After upgrading to vee-validate 4.12.3 from 4.11.8 we no longer get the error message to the ref we extract from useField in the radio button group component.
Another difference is that if we show error message on each radio button, only the last one in the set shows error message after upgrade, while earlier all showed the same message.
I read that some functions are getting deprecated, but I didn't see useField among those, which is the one used here.
Note: Only reason I haven't checked Safari among browsers is that I haven't tried it.
Reproduction steps
Error version 4.12.3
Working version 4.11.8
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-template-kknk94
Code of Conduct
The text was updated successfully, but these errors were encountered: