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: formState isDirty breaks under certain conditions #11773

Closed
1 task done
jgullstr opened this issue Apr 10, 2024 · 0 comments
Closed
1 task done

issue: formState isDirty breaks under certain conditions #11773

jgullstr opened this issue Apr 10, 2024 · 0 comments
Labels
regression Regression with code change

Comments

@jgullstr
Copy link
Contributor

Version Number

7.51.2

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/compassionate-https-9kh375

Steps to reproduce

  1. Open sandbox
  2. Edit textfield (optional). Notice that isDirty correctly sets to true.
  3. Click "Reset".
  4. Editing textfield will not set isDirty to true anymore.
  • Looks like this behavior was Introduced in 7.51.0.
  • If isSubmitting and isValid are removed from the code, it seems that isDirty behaves as expected. This implies that the erroneous behavior of isDirty may be introduced while reading other parts of the formState.

Expected behaviour

isDirty should be true when value differs from default.

What browsers are you seeing the problem on?

Firefox, Chrome

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049 bluebill1049 added the regression Regression with code change label Apr 11, 2024
rafaelcalhau pushed a commit to rafaelcalhau/react-hook-form that referenced this issue May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Regression with code change
Projects
None yet
Development

No branches or pull requests

2 participants