Discard Changes: Check before unload#23107
Conversation
|
Claude finished @nielslyngsoe's task in 2m 19s —— View job PR ReviewTarget: Adds a
Suggestions
Approved with Suggestions for improvementGood to go, but please carefully consider the importance of the suggestions. |
There was a problem hiding this comment.
Pull request overview
Adds an unload-time safeguard to entity detail workspaces so users are prompted before closing the tab/window when there are unpersisted changes.
Changes:
- Register a
beforeunloadhandler to block page unload whengetHasUnpersistedChanges()is true. - Unregister the
beforeunloadhandler indestroy()to avoid leaking listeners.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|


Checking for discard changes before unloading the page, aka. closing the tab/browser.
Cause the browser to ask if the user is sure about closing the tab when having unsaved changes