Support Article
Pop up appears when closing a new tab
SA-9225
Summary
Clicked 'X’ on new tab (close that new tab) – pop up with "Are you sure you want to leave this page?" message appears.
Error Messages
No error messages
Steps to Reproduce
1. Open a new tab (create a new work object).
2. Close that tab by clicking on the 'X' (cross) icon.

Root Cause
The root cause of this problem is in a third-party product, that is the end user browser. This message of "Are you sure you want to Leave this page?" appears when the browser page is dirty, that is, the page has been modified (example, a tab has been closed), however, it has not been comitted yet and it is residing in the browser's cache.
Resolution
This issue is resolved through the following local change:
1. Save the HTML Fragment UserWorkForm into user's own ruleset (if it is not already).
2. Add the following script to UserWorkForm
<script>
if (parent && parent.pega && parent.pega.u && parent.pega.u.d) {
parent.pega.u.d.gDirtyOverride = false;
}
pega.u.d.gDirtyOverride = false;
</script>
3. Save the form and test the behaviour.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.