two backward transitions with data-rel='back' in latest #3939

Closed
johnbender opened this Issue Mar 29, 2012 · 7 comments

Comments

Projects
None yet
5 participants
Contributor

johnbender commented Mar 29, 2012

< deAtog> Hello everyone. I'm having a problem with page transitions in jQuery Mobile git version.. I've got a link with data-rel="back" that seems to cause two backwards transitions rather than one..

....

< deAtog> johnbender: the app with the issue is here: http://dev.itreetools.org/ellingsd/itree/
< deAtog> if you navigate to Add Tree->Pest and then click on Yes under Tree Stress.. it'll navigate to another page, upon clicking Cancel it'll navigate back to the Pest page, but if you click Yes again then followed by Cancel you end back up at the Add Tree page
< deAtog> sorry.. url should be http://dev.itreetools.org/ellingsd/itree/home.php

...

< deAtog> johnbender: I've only seen the issue on Android.. I can't seem to reproduce the issue on my desktop under Firefox 11
Contributor

johnbender commented Mar 29, 2012

I'm able to reproduce on Android 2.3.

Contributor

johnbender commented Mar 29, 2012

deAtog,

Try disabling pushState with:

$( window ).bind( 'mobileinit', function(){
  $.mobile.pushStateEnabled = false;
});

deAtog commented Apr 5, 2012

Disabling pushState corrects this issue on Android 2.2 for me.

I encountered a similar problem in Chrome 18/Mac. Setting pushStateEnabled to false corrected the issue for me as well.

oste commented Jun 7, 2012

I tried to disable pushStateEnabled but I am still getting the double back button issue on Android 2.3.6

This is the code I used

<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script>
$( window ).bind( 'mobileinit', function(){
    $.mobile.pushStateEnabled = false;
});
</script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>

Are there any further updates on this issue?

I also tried

<a href="/" onclick="history.back(-1)" >Back</a>

but this also causes the double back issue...

oste commented Jun 8, 2012

It looks like changing 'window' to 'document' seems to work better.

Here is the updated code that works

<script>
$( document ).bind( 'mobileinit', function(){
    $.mobile.pushStateEnabled = false;
});
</script>
Owner

arschmitz commented Aug 7, 2013

this is stale for over a and nav has been refactored im going to close this if someone can provide a jsbin test page showing the problem still exists will gladly reopen

@arschmitz arschmitz closed this Aug 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment