Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

back buttons are now going back "too far" #1870

Closed
shawnwall opened this issue Jun 21, 2011 · 8 comments
Closed

back buttons are now going back "too far" #1870

shawnwall opened this issue Jun 21, 2011 · 8 comments

Comments

@shawnwall
Copy link

I'm testing out beta1 and read about the back button change. I've modified my simple site which consists of three pages:

-index
-subpage
-subsubpage

I've added data-add-back-btn="true" to the div's with data-role of page and the buttons are now appearing again. The defect is that when I click from index to subpage, then subpage to subsubpage, the back link in the upper left takes me all the way back to the index page instead of the subpage.

The links between the pages are normal A links going to separate actual pages through the default ajax (they are not separate divs within one single page).

@shawnwall
Copy link
Author

The same defect occurs when using:

$(document).bind("mobileinit", function() {
      $.mobile.page.prototype.options.addBackBtn = true;
 });

@mweimerskirch
Copy link

Same problem here. I might add that I have the pages as separate divs in one single document. I also noticed that the "native" back button still works.

@Phliplip
Copy link

I have the same problem, and would like to add that closing dialogs also triggers the bug.

@mweimerskirch
Copy link

Digging deeper, I found that history.back() is executed twice because of this line:

$( document ).bind( $.mobile.useFastClick ? "vclick click" : "click", function( event ) {

Disabling fastClick should be a valid workaround, but that does not work either, see #1869.
So for now I set "useFastClick" to false in the jquery mobile source code so that only the "click" event is used and not both "vclick" and "click".

BTW: The problem appeared on both Chrome 13beta and Firefox 5. I did not yet bother testing on a mobile device.

@IgitBuh
Copy link

IgitBuh commented Jun 21, 2011

Same here. Strangly it's not consistently happening. In rare cases it's correctly going back one step only.
edit: tested on iOS 4.3.2

@shawnwall
Copy link
Author

I just noticed that it is consistently working for me when I test the site on mobile safari. The original issue still stands with desktop safari.

@scottjehl
Copy link

So, the vclick + click is in there as a workaround for an inconsistent bug Android 2.1, but now that we've pushed beta out, I'm going to remove that double binding and work on a better solution for the Android issue. Fix coming shortly.

@Phliplip
Copy link

Still have issues with iOS.. Also an intentional doubletab/click will mosdef take you 2 pages back, and a tripple tab/click wil wil take you back 3 pages. I tried this with http://www.jquerymobile.com/test/ -> Pages and dialogs -> Dialogs -> Open first dialog.. Tapping close muliple times. 3 times takes me back to front page of ../test/

Also the initial problem still occour - where you click (or intend to click) only once - and it takes you back 2 pages. Though not as common as before, tried with newest JQM-source (g7451a4b) on my dev site.

Lastly, using Firefox 3.6.17 - will go 2 pages back everytime.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants