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

meta.required not detected when validation schema is passed after useForm() is called #4738

Closed
5 tasks done
hanzelkatomas opened this issue Apr 29, 2024 · 1 comment
Closed
5 tasks done

Comments

@hanzelkatomas
Copy link

What happened?

In some use cases there is need to assign validation schema to useForm() after useForm() is called. It is useful when you load validation schema from an external resource. We specifically need to pass validation schema after useForm(), because we have multi step form Wizard, which uses inject/provide API, where each component represent single step of multi step form and each component injects validation schema to parent, when is mounted.

Since you can pass Ref to validation schema property in useForm(), which indicates that validation schema might change, I would expect that passing typed schema should work also with correct meta.required on each input.

Is it possible to make meta.required working even if we pass validation schema after useForm() or ideally, couldn't meta.required property refresh when validation schema change is detected?

Reproduction steps

  1. Just open the demo

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://stackblitz.com/edit/vue-z6mle2?file=src%2FApp.vue

Code of Conduct

@logaretm
Copy link
Owner

logaretm commented May 6, 2024

Hello, thanks for reporting this. I found a quick fix or it and will tag a release in a couple of hours. And I appreciate the clear demo.

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

No branches or pull requests

2 participants