New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
5 participants
@shawnwall

shawnwall commented Jun 21, 2011

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

This comment has been minimized.

Show comment
Hide comment
@shawnwall

shawnwall Jun 21, 2011

The same defect occurs when using:

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

shawnwall commented Jun 21, 2011

The same defect occurs when using:

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

This comment has been minimized.

Show comment
Hide comment
@mweimerskirch

mweimerskirch Jun 21, 2011

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.

mweimerskirch commented Jun 21, 2011

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

This comment has been minimized.

Show comment
Hide comment
@Phliplip

Phliplip Jun 21, 2011

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

Phliplip commented Jun 21, 2011

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

@mweimerskirch

This comment has been minimized.

Show comment
Hide comment
@mweimerskirch

mweimerskirch Jun 21, 2011

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.

mweimerskirch commented Jun 21, 2011

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

This comment has been minimized.

Show comment
Hide comment
@IgitBuh

IgitBuh 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

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

This comment has been minimized.

Show comment
Hide comment
@shawnwall

shawnwall Jun 21, 2011

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.

shawnwall commented Jun 21, 2011

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

This comment has been minimized.

Show comment
Hide comment
@scottjehl

scottjehl Jun 21, 2011

Contributor

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.

Contributor

scottjehl commented Jun 21, 2011

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.

@scottjehl scottjehl closed this in c227535 Jun 21, 2011

@Phliplip

This comment has been minimized.

Show comment
Hide comment
@Phliplip

Phliplip Jun 23, 2011

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.

Phliplip commented Jun 23, 2011

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 join this conversation on GitHub. Already have an account? Sign in to comment