jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.68k stars 2.4k forks source link

`firstPage` is not added to history when `hashListeningEnabled` is `false` #8006

Open Ajaxy opened 9 years ago

Ajaxy commented 9 years ago

Resuming #8005

Issue description firstPage is not added to history when hashListeningEnabled is false. There is no posibility to go back to it or from it.

Test page (see below) http://jsfiddle.net/j0xynapm/ — wrong navigation back from first page http://jsfiddle.net/3vy56g6e/ — navigation back missing first page

Steps to reproduce Turn off hashListeningEnabled setting and use $.mobile.navigate.history.* or $.mobile.back() or $.mobile.pageContainer.pagecontainer( "back" ).

Expected outcome Every page should be added to history. Navigation should not miss pages.

Actual outcome Cannot navigate back from first to last page (navigating back to the second one), cannot navigate back from second to first page (navigating back to the last one).

Platforms/browsers (including version) and devices tested All.

jQuery Mobile and jQuery core version used 1.4.2 / 2.1.0

gabrielschulhof commented 9 years ago

This is an unfortunate consequence of our overly complicated navigation-related flag system. If you turn off hash listening, you turn off history, and jQuery Mobile becomes nothing more than a DOM manipulation framework - or that's how it should be. In fact, there is also the changeHash flag that is passed to the pagecontainer change() method which, when set to false, will cause page changes to be mere DOM operations, not involving the browser's history API at all.

We need to clean this up for 1.6.0.