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

Similar keys in object schema causing field to use the wrong validation #2252

Open
webdevnerdstuff opened this issue Oct 23, 2024 · 1 comment

Comments

@webdevnerdstuff
Copy link

Describe the bug
When there are similar key's in the validation schema, it is causing it to not use the incorrect validation. I think this is a yup issue not a vee-validate issue?

To Reproduce

  1. Open https://stackblitz.com/edit/vitejs-vite-l6n3zb?file=src%2Fcomponents%2FHelloWorld.vue
  2. Click on "Submit" in the example
  3. Notice it's using the fooBar validation not foo
  4. Remove or comment out line 9.
  5. Click on "Submit" in the example
  6. Notice it's using the fooBiz validation not foo

ex. schema

const schema = object({
  foo: string().required(isRequired('Foo')),
  fooBar: string().required(isRequired('Foo Bar')),
  fooBiz: string().required(isRequired('Foo Biz')),
});

Expected behavior
It should use the correct validation set.

Platform (please complete the following information):

  • Yup Version ^1.4.0
  • VeeValidate Version ^4.14.4
@webdevnerdstuff
Copy link
Author

@jquense Just checking in, as I haven't heard anything about this submission/bug.

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

1 participant