You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click Submit, and we receive a message in alert {"data":{"firstName":"Ivan","lastName":"Ivanov"},"isDirty":false}
Click button unregister lastname field
Click Submit, and we receive a message in alert {"data":{"firstName":"Ivan"},"isDirty":false}
Expected behaviour
In our project, we often come across a situation where we have an optional field. We register it or unregister using the checkbox. We don't want to store the checkbox state in the form and want to disable the sumbit button when the data hasn't changed.
We are faced with the fact that we have unregister/register fields, the data that goes into the submit function changes, but the form is not considered isDirty.
Should we change the behavior for isDirty in the library or do we need to create a new field?
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Version Number
7.51.3
Codesandbox/Expo snack
https://codesandbox.io/p/devbox/amazing-mahavira-29tzmd
Steps to reproduce
Click Submit, and we receive a message in alert
{"data":{"firstName":"Ivan","lastName":"Ivanov"},"isDirty":false}
Click button unregister lastname field
Click Submit, and we receive a message in alert
{"data":{"firstName":"Ivan"},"isDirty":false}
Expected behaviour
In our project, we often come across a situation where we have an optional field. We register it or unregister using the checkbox. We don't want to store the checkbox state in the form and want to disable the sumbit button when the data hasn't changed.
We are faced with the fact that we have unregister/register fields, the data that goes into the submit function changes, but the form is not considered isDirty.
Should we change the behavior for isDirty in the library or do we need to create a new field?
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: