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

$validationGroups: there's not a way to group errors from nested forms. #1216

Open
renatodeleao opened this issue Nov 15, 2023 · 0 comments
Open

Comments

@renatodeleao
Copy link

renatodeleao commented Nov 15, 2023

Describe the bug
If using nested forms, as described by documentation, the errors from nested forms are indeed caught by the parent component. But there no way (unless hand-rolled) to group those errors into $validationGroups. This is particularly important in stepped forms where errors are scoped (grouped) by step, and especially if those nested form are reusable component instances, that cannot be hardcoded into root form state.

Reproduction URL
https://codesandbox.io/s/multi-step-form-with-vuelidate-nested-forms-hrs266?file=/src/App.vue

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'step with nested form tab'
  2. Type to validate on the "something" field, (see that $validationGroups catches the error and updates tab error count)
  3. Type to validate on the nested form field
  4. See error. Even if root form catches the error $validationGroups does not update to reflect nested errors.

Expected behavior
Expect that $validationGroups work with nested forms, either by passing the $registerAs path or the actual nested fields paths. But none of that works.

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