[Bug]: Regression bug generated by releases v7.15.3 (Form Reset)
Version Number
7.15.3
Codesandbox/Expo snack
https://codesandbox.io/s/eloquent-breeze-gywwy?file=/src/Form.tsx
Steps to reproduce
Scenario 1
- Enter any string in the first name field
- Click on the reset button
- Enter any string in the last name field
- Check the dev tool Actual: you should find both first & last names fields isDirty equals tor true
Scenario 2
- Enter any string in the first name field
- Enter any string in the last name field
- Click on the Save button (note that I reset the form with newly saved data after save)
- Change the value in the first name field
- Check the dev tool Actual: you should find both fields has isDirty as false
Expected behaviour
Scenario 1 Expected: you should find only the last name field isDirty equals tor true
Scenario 2 Expected: you should find the first name field isDirty equals tor true
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
I want to add that this issue can be reproduced by any release from v7.8.0 to v7.15.3 and to avoid it I had to fall back to v7.7.1 Here is a fork of the issue sandbox bosted above but with correct behaviors https://codesandbox.io/s/react-hook-form-reset-7-7-1-98hh2
@bluebill1049 : Why this ticket was moved here? If you checked this sandbox you should find form state returned form useFormState also show the same state issues on v7.8.0
Check the dev tool Actual: you should find both first & last names fields isDirty equals tor true
please remove the dev tool and all the other dependencies if this issue is related to the core lib, I just did a quick test with your description above and it works.
update your codesandbox i will take a look at again if its an issue to the core lib or dev tool
Hi @bluebill1049 : I removed the devtool & tried and I couldn't reproduce these issues anymore, Why the devtools could effect the core functionality for the library?
i suspect it's a bug in the dev tool.