- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[BUG] Warn unsaved changes when there are no changes #6691
Comments
i tried to find the issue for about 2 days but could recreate it and the app is working fine maybe i could't recreated the issue here is the proof |
Hey @Varun789-mx , you are showing the bug in the video. You removed a space and added it back, so there are no changes, but the warning is popping up saying you have unsaved changes. |
Hello @alicanerdurmaz, Can i work on this? |
Yes @mohit-2003, thanks for improving Refine 🙌 |
Hi @alicanerdurmaz, I tested |
Did you provide We can solve the issue by checking the old and new values, but I don’t prefer this. |
Hello @alicanerdurmaz, You were absolutely right! After providing default values, In As shown in the attached image, I've added A in Content. The I’ve done extensive debugging but still haven’t found a way to fix this. Do you have any ideas on this? |
…edev#6691) Used useEffect to track isDirty and update setWarnWhen accordingly.
@mohit-2003 Is this |
Yes @alicanerdurmaz, I did hours of debugging but didn't find any way to fix this. In my PR #6702, I am watching the |
Describe the bug
When setting
warnWhenUnsavedChanges: true
, if the user changes a field but then undo the change and try to navigate to another page, the warn modal pops up even if there aren't no real data changes.Steps To Reproduce
warnWhenUnsavedChanges: true
in<Refine />
Expected behavior
Should check the actual values for changes and show the modal only if there are actual changes to the data.
Packages
Additional Context
No response
The text was updated successfully, but these errors were encountered: