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

issue: isValidating property from useFormState hook gets stuck in true state after validation in v7.40.0 #9521

Closed
1 task done
jbaldassari opened this issue Dec 5, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@jbaldassari
Copy link

Version Number

7.40.0

Codesandbox/Expo snack

https://codesandbox.io/s/react-hook-form-isvalidating-stuck-js9gpj?file=/src/index.tsx

Steps to reproduce

  1. Go to code sandbox
  2. Focus the only input field
  3. Type one character
  4. Observe that the Submit button correctly changes state from disabled to enabled
  5. Type a second character into the input field
  6. Observe that the Submit button erroneously changes state from enabled to disabled despite the fact that the form is valid
  7. Look at the console logs which show that isValidating is stuck in true state, which is causing the submit button to be disabled
  8. Change the version of react-hook-form to 7.39.7 in package.json and observe that isValidating does not get stuck in true state after typing more than one character into the input field

If you change the form's mode from onChange to onBlur, you can type multiple characters into the field initially, but as soon as the field is blurred isValidating gets stuck in true state.

Expected behaviour

The isValidating property should update from true to false once validation has completed. This issue seems similar to #9251, but in this case the behavior can be reproduced consistently, and it's just using vanilla yum validation. This behavior was introduced in 7.40.0. It works as expected in 7.39.7 and prior.

What browsers are you seeing the problem on?

Chrome

Relevant log output

enabled: true 
{isDirty: true, isSubmitting: false, isValid: true, isValidating: false}

enabled: false 
{isDirty: true, isSubmitting: false, isValid: true, isValidating: true}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049 bluebill1049 added status: under investigation aware of this issue and pending for investigation bug Something isn't working and removed bug Something isn't working status: under investigation aware of this issue and pending for investigation labels Dec 5, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2023
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