Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Reloading pages after a dialog breaks navigation #5122

MauriceG opened this Issue · 7 comments

4 participants


Issue description:
Reloading pages after a dialog breaks navigation and the dialog url is kept in history

Test page:

Steps to reproduce:
1. Go to the demo, 2. open the dialog, 3. goto page 2, 4. reload the page, 5. go back to page 1, 6. open the dialog

Expected outcome:
The dialog should open even after a page reload

Actual outcome:
The dialog does not open anymore after reloading a page after the dialog

Platforms/browsers (including version) and devices tested:
Safari 5.1.7 / Win, Safari iOS 6 iPad 3 and iPhone 4S, Chrome 22 Win, FF 14 and 15 Win, Opera 11.64 Win, Opera Mobile Emulator

jQuery Mobile and jQuery core version used:
jQueryMobile latest -- Core 1.8.2

Other relevant information:
Same scenario works with popups:


The idea of dialogs is to not be open after page load, so this is expected behavior. It would be easy enough to disable this behavior through an option if desirable, but we built dialogs to satisfy the following guidelines:

  • Open an external document with all typical "page" properties, but a different visual treatment.
  • Update the URL using a known, null-value has (even in pushstate-supporting browsers) so that the dialog can be dismissed via the back button, but not reachable through a link.
  • When a URL containing a dialog hash is opened, the page that is listed prior to the null dialog hash should be shown.

Are we reconsidering these goals now? If not, should we close this out as wontfix?


/cc @johnbender


I think the issue is with you're 3rd bullet. The framework does indeed hop back to the page before the dialog (page 1) but the URL isn't cleaned up properly and has a &ui-state=dialog tacked on when it shouldn't.


I guess when navigating forward to a new page from a dialog, we could replaceState to the current URL sans &ui-state=dialog before progressing? Maybe we should clarify the issue if that's the part we want to fix.


Yep, think that's it. Right now, it possible to break things by just opening a popup, then refreshing. The framework will route you back to the previous page because we don't allow for deep-linking to dialogs but the URL still has the &ui-state=dialog and we need to clean that up. If we don't, then if you try to open another dialog, it fails because we already have that in the URL.


@MauriceG - Are you tinkering with the code in these demos or it is just stock links? In your demo, opening a popup and refreshing also kills all future popups, no need to do that long chain. However, when I tested that scenario in 1.1, 1.2 and latest, I can open a popup, refresh and open another popup just fine. What's the difference?


Actually, maybe I was wrong. Refreshing a dialog on your test page is working ok. False alarm.


No response on this in two months and the issue did not seem to be clear . going to close as stale

@arschmitz arschmitz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.