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
There is already functionality in place to detect whether a Profile has edits, currently used to enable/disable the Save button. This should be taken one more step to prompt the user before refreshing/reloading, or navigating away and losing edited form data.
The text was updated successfully, but these errors were encountered:
I took a look into this and would like to propose an implementation using react-router Prompt and some native DOM events to prevent navigation away / closing if there are unsaved changes. I would use the hasEditedProfile state you mentioned to conditionally block navigation with a warning toast message.
I'm happy to claim this enhancement ticket and get to work. I'll update here as development ensues.
Great thought, but one issue -- I believe Prompt is only available in router v5, not v6. Let me know if you find that's not the case, but I'm fairly sure Prompt was removed after v5.
Ah, you're right. How strange. Looks like I'll have to build the functionality myself. More fun for me! I think I can still manage it, just with a bit more creativity. Good catch.
There is already functionality in place to detect whether a Profile has edits, currently used to enable/disable the Save button. This should be taken one more step to prompt the user before refreshing/reloading, or navigating away and losing edited form data.
The text was updated successfully, but these errors were encountered: