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

6.8.4 clearErrors with nested fields + formState.isValid #2972

Closed
szymonlesisz opened this issue Sep 22, 2020 · 0 comments
Closed

6.8.4 clearErrors with nested fields + formState.isValid #2972

szymonlesisz opened this issue Sep 22, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@szymonlesisz
Copy link

szymonlesisz commented Sep 22, 2020

Describe the bug
Calling clearErrors doesn't have affect on formState.isValid field

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/react-hook-form-useform-template-forked-j4wqk?file=/src/index.js
  2. Click on 'Step 1'
  3. Click on 'Step 2'
  4. See console logs

There are two cases:

  1. if setValue in "step 2" triggers validation (shouldValidate: true) errors object is empty
  2. if setValue in "step 2" doesn't trigger validation errors object is not empty but got undefined values

In both cases formState.isValid is set to false

Expected behavior
formState.isValid should be set to true after "Step 2"

@bluebill1049 bluebill1049 added the not valid not valid issue, question or suggestion label Sep 22, 2020
@bluebill1049 bluebill1049 reopened this Sep 22, 2020
@bluebill1049 bluebill1049 added status: under investigation aware of this issue and pending for investigation bug Something isn't working and removed not valid not valid issue, question or suggestion status: under investigation aware of this issue and pending for investigation labels Sep 22, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 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

2 participants