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

Partial check valibot not returning all errors #716

Open
themre opened this issue Sep 23, 2024 · 1 comment
Open

Partial check valibot not returning all errors #716

themre opened this issue Sep 23, 2024 · 1 comment

Comments

@themre
Copy link

themre commented Sep 23, 2024

Describe the bug
When using valibot resolver and partialCheck with forward, I do not see all errors that are returned from useForm. Vanilla Valibot however returns all errors. In the provided example I want to see email AND password2 being invalid. RHK returns password2 error only once I fix email. I am using latest libraries.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/p/sandbox/wdxr64?file=%2Fsrc%2FApp.tsx%3A34%2C1
  2. Click on Submit
  3. In the console you will see only email error, where in the log for valibot parseSafe you will see 2 errors.

Codesandbox link (Required)
https://codesandbox.io/p/sandbox/wdxr64?file=%2Fsrc%2FApp.tsx%3A34%2C1

Expected behavior
2 errors for email and password2 should be listed.

@themre
Copy link
Author

themre commented Sep 23, 2024

Found out that I need to set additional properties for type of validation in useForm as second argument:

shouldUseNativeValidation: false,
criteriaMode: "all",

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