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

Wrong transition when using back/forward browser buttons #1867

Closed
IgitBuh opened this Issue Jun 21, 2011 · 6 comments

Comments

Projects
None yet
8 participants
@IgitBuh

IgitBuh commented Jun 21, 2011

The transition effect is not performed correctly when using back/forward browser buttons.

How to reproduce (tested with iOS 4.3.2 and Android 2.2):

  1. Create 3 pages (A, B, C)
  2. On page A create a button-link to B with transition "flip"
  3. On page B create a button-link to C with transition "slide"
  4. Load page A in browser
  5. Click the button. You'll be navigated to page B with the a flip-effect
  6. On page B click the button. You'll be navigated to page C with a slide-effect
  7. Click browser back button, you'll be navigated to page B with a reverse-slide-effect,
  8. Now click the browser forward button and you'll be navigated from page B to page C with the flip-effect - which is incorrect!

It seems the page history remembers only the transition effect that was used to get to it, but not the transition effect that was used to get from it.

@scottjehl

This comment has been minimized.

Show comment
Hide comment
@scottjehl

scottjehl Jun 21, 2011

Contributor

Sounds like we need a condition that says, "when we think it's a "back button" click, use the transition from the current page, rather than the page we're going to...

Contributor

scottjehl commented Jun 21, 2011

Sounds like we need a condition that says, "when we think it's a "back button" click, use the transition from the current page, rather than the page we're going to...

@ghost ghost assigned scottjehl Jul 7, 2011

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Feb 15, 2012

Contributor

Is this still an issue with 1.0.1?
Also please test on master (1.1-pre): www.jquerymobile.com/test

Contributor

toddparker commented Feb 15, 2012

Is this still an issue with 1.0.1?
Also please test on master (1.1-pre): www.jquerymobile.com/test

@agcolom

This comment has been minimized.

Show comment
Hide comment
@agcolom

agcolom Mar 17, 2012

Member

@toddparker @scottjehl here's a jsfiddle to illustrate:
http://jsfiddle.net/agcolom/qeqB2/16/show/

It is still present in latest

Member

agcolom commented Mar 17, 2012

@toddparker @scottjehl here's a jsfiddle to illustrate:
http://jsfiddle.net/agcolom/qeqB2/16/show/

It is still present in latest

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Mar 23, 2012

Contributor

Thanks for the jsfiddle @agcolom - we'll give this a look.

Contributor

toddparker commented Mar 23, 2012

Thanks for the jsfiddle @agcolom - we'll give this a look.

@adriancd

This comment has been minimized.

Show comment
Hide comment
@adriancd

adriancd Jun 14, 2012

Here is another example of the same issue http://jsfiddle.net/645Xm/

If you use the buttons in the window then the animations go in the correct directions but if you use the browser back button with the right click menu on the second page then the following animation back to the first page is in the wrong direction.

adriancd commented Jun 14, 2012

Here is another example of the same issue http://jsfiddle.net/645Xm/

If you use the buttons in the window then the animations go in the correct directions but if you use the browser back button with the right click menu on the second page then the following animation back to the first page is in the wrong direction.

@ghost ghost assigned johnbender Sep 24, 2012

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Jun 9, 2014

Contributor

The setup as described by the OP: http://jsbin.com/IFolanOW/493/
It still works that way.

Contributor

gabrielschulhof commented Jun 9, 2014

The setup as described by the OP: http://jsbin.com/IFolanOW/493/
It still works that way.

gabrielschulhof added a commit that referenced this issue Jun 9, 2014

Navigation: When going forward, grab transition from current entry
Our history entries contain exactly one transition: The one used to arrive at
the entry. In addition, the index of the current entry and that of the previous
entry is updated before the value for the transition is computed. So, it makes
sense, when going backwards, to read the transition value from the previous
entry, because that value stores the transition that was used to get there from
where history is currently at.

However, when going forward, it makes no sense to read the transition value
from the previous entry, because that one stores the transition that was used
to reach it, not the transition that must be used to reach the next entry.

Fixes gh-1867

@gabrielschulhof gabrielschulhof added this to the 1.4.4 milestone Jun 9, 2014

@gabrielschulhof gabrielschulhof self-assigned this Jun 9, 2014

@jaspermdegroot jaspermdegroot modified the milestone: 1.4.4 Jun 11, 2014

gabrielschulhof added a commit that referenced this issue Jul 24, 2014

Navigation: When going forward, grab transition from current entry
Our history entries contain exactly one transition: The one used to arrive at
the entry. In addition, the index of the current entry and that of the previous
entry is updated before the value for the transition is computed. So, it makes
sense, when going backwards, to read the transition value from the previous
entry, because that value stores the transition that was used to get there from
where history is currently at.

However, when going forward, it makes no sense to read the transition value
from the previous entry, because that one stores the transition that was used
to reach it, not the transition that must be used to reach the next entry.

Closes gh-7485
Fixes gh-1867
Fixes gh-4951

agcolom added a commit to agcolom/jquery-mobile that referenced this issue Nov 26, 2014

Navigation: When going forward, grab transition from current entry
Our history entries contain exactly one transition: The one used to arrive at
the entry. In addition, the index of the current entry and that of the previous
entry is updated before the value for the transition is computed. So, it makes
sense, when going backwards, to read the transition value from the previous
entry, because that value stores the transition that was used to get there from
where history is currently at.

However, when going forward, it makes no sense to read the transition value
from the previous entry, because that one stores the transition that was used
to reach it, not the transition that must be used to reach the next entry.

Closes jquerygh-7485
Fixes jquerygh-1867
Fixes jquerygh-4951
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment