Changing to a new page from a page that has been previously loaded using AJAX (external page) triggers a removal of this external page. This seems completely logical and you can also disable this behaviour using data-dom-cache="true".
However, when it comes to dialogs the removal of the previously loaded external page is probably not what you want (regardless of what data-dom-cache is set to) because it's most likely that closing the dialog should show the underlying page again.
Currently this triggers a reload which also means that all modifications to that page (checkboxes being checked, filled forms etc.) are gone.
Expected result: If the new page is a dialog the previous page should not be removed from DOM.
Online test page:
There's also a post on stackoverflow addressing this problem:
Dialog: adjusted pagehide handler to not remove pages when dialogs op…
…en. Fixed #5239 - dialog: External page being reloaded when dialog closes
@maurice2k this is currently this is the expected behavior since dialogs are just a way of displaying a page im going to mark this as a feature request add to the wiki and close. we will reopen if we decide to implement this.