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

Validation does't work correctly using Controller and react-select #1931

Closed
tafelito opened this issue Jun 21, 2020 · 11 comments
Closed

Validation does't work correctly using Controller and react-select #1931

tafelito opened this issue Jun 21, 2020 · 11 comments
Labels
bug Something isn't working

Comments

@tafelito
Copy link

Describe the bug
when using a react-select component with controller, the validation does not work properl when using reValidateMode: 'onBlur'

the select component is validating onBlur all the time, not only after the form was submitted. As i Understand, by using the reValidateMode: 'onBlur' makes the inputs validates onBlur instead of onChange. But the select is validating onBlur even when the form was not submitted

here's the codesandbox
https://codesandbox.io/s/react-hook-form-usefieldarray-template-mj7vm?file=/src/index.js

@bluebill1049
Copy link
Member

can you provide a codesandbox? The one you have attached seems to be wrong.

@bluebill1049 bluebill1049 added the status: need more detail Please follow our issue template. label Jun 21, 2020
@tafelito
Copy link
Author

@bluebill1049 bluebill1049 added status: under investigation aware of this issue and pending for investigation bug Something isn't working and removed status: need more detail Please follow our issue template. status: under investigation aware of this issue and pending for investigation labels Jun 22, 2020
bluebill1049 added a commit that referenced this issue Jun 22, 2020
@tafelito
Copy link
Author

I'm amazed on how quick your response is in answering every issue and fixing them if needed. 👏👏

Thanks for you hard work!

@bluebill1049
Copy link
Member

no worries @tafelito I try my best 🙉

@tafelito
Copy link
Author

By the way, since the next version will deprecate valisationSchema, it would be great if somehow the validation resolver could tell what field is changing the value, specially after the a form is submitted and the validation occurs on the onChange event, to validate only the field that is changing and not the whole schema. I found that with complex schemas it can get very slow and you notice a lag while typing

@bluebill1049
Copy link
Member

for schema it will be quite difficult to achieve, we do that for build-in validation tho.

@tafelito
Copy link
Author

for schema yes, but what about for the resolver? There, if you get the field, one can decide to validate the whole schema of just the field

@tafelito
Copy link
Author

@bluebill1049 are you going to release this on V6 or are you planning on release a patch for v5?

@bluebill1049
Copy link
Member

hey @tafelito we going to release V6.

@jonasmarco
Copy link

jonasmarco commented Aug 21, 2022

Can anyone help me validate?

@bluebill1049
@tafelito
@evocateur
@aaronjensen

CodeSandBox code

@Moshyfawn
Copy link
Member

Can anyone help me validate?

@bluebill1049 @tafelito @evocateur @aaronjensen

CodeSandBox code

Care to elaborate?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants