I use a simple jQuery plugin (Are You Sure) to detect when a form is "dirty" and to catch the page beforeUnload event to prompt the user if they are sure they want to leave the page while they have unsaved/unsubmitted work. This works great when you have a new submission (which loads in its own window), but it does not work for a form that has been sent to someone as a User Task and they open it from the Inbox (which loads in some kind of AngularJS side panel that does not behave like a window). Is there a good way to detect when the user presses the "X" in the side panel and display the warning about unsaved data? In my testing, the plugin actually does detect the beforeUnload event if you click on a second item in the inbox to switch to it, but it does not detect closing this side pane.
If this isn't possible currently, then maybe it should be a feature request... It's very easy to make some changes to a form in that side panel and then accidentally close it and lose your changes.
Thanks!