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

$externalResults won't apply if field does not have at least one client side validator rule defined #1209

Open
renatodeleao opened this issue Sep 25, 2023 · 1 comment

Comments

@renatodeleao
Copy link

renatodeleao commented Sep 25, 2023

Describe the bug
I have a field that only has server-side validation. To oblige with vuelidate rules, the field is defined in the rules object, but has an empty object assigned (no validators). When returning validations from the server and applying them to $externalResults, as per the documentation, the validation errors are not displayed for this particular field, while still showing for other fields with rules

Reproduction URL
https://stackblitz.com/edit/vitejs-vite-wbmiw8?file=src%2FApp.vue

To Reproduce

  1. Click the submit button and see that external results are only applied to the first field (which has rules defined)

Expected behavior

  1. External results validations should be applied to all fields, even if they don't have a client-side rule defined.

Additional context
As a workaround, I've added a placebo rule that always returns true to make things work, but I shouldn't have to and it took me long to figure out this was the reason. If that's the intended behaviour, it should be documented.

@renatodeleao
Copy link
Author

Related #1147

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

No branches or pull requests

1 participant