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: resetField sets same object as both defaultValues and formValues, breaking state updates #11328

Closed
1 task done
geeee opened this issue Dec 21, 2023 · 0 comments · Fixed by johnchoi96/johnchoi96.github.io#169 · 4 remaining pull requests
Closed
1 task done

issue: resetField sets same object as both defaultValues and formValues, breaking state updates #11328

geeee opened this issue Dec 21, 2023 · 0 comments · Fixed by johnchoi96/johnchoi96.github.io#169 · 4 remaining pull requests

Comments

@geeee
Copy link
Contributor

geeee commented Dec 21, 2023

Version Number

7.49.2

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/adoring-cdn-lsvhgf

Steps to reproduce

  1. Go to https://codesandbox.io/p/sandbox/adoring-cdn-lsvhgf
  2. Make sure isFormDirty and isFieldDirty are updated on text input
  3. Click on Reset Field button
  4. Observe isFormDirty and isFieldDirty no longer working properly, always showing false

Expected behaviour

isDirty should continue to work after resetField(), same as it does after reset()

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@geeee geeee changed the title resetField sets same object as both defaultValues and formValues, breaking state updates issue: resetField sets same object as both defaultValues and formValues, breaking state updates Dec 21, 2023
geeee added a commit to geeee/react-hook-form that referenced this issue Dec 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.