Reloading pages after a dialog breaks navigation and the dialog url is kept in history
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
The dialog should open even after a page reload
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: http://test.jqmobile.de/dialogReload/ppp.html
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:
Are we reconsidering these goals now? If not, should we close this out as wontfix?
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