Setting the transition direction animation

@adam I would also like to know the answer to this :smiley:

This is a big one for me. The animation direction will often go left to right even when travelling back through the navigation stack.
Any work arounds to this?

1 Like

I wound up changing the UX flow of my app so that it didn’t really make a big difference anymore. What I had found out is that navigation animations are grouped by tab groups as each tab group has its own “history”. A navigation to the page you were just on triggers a backwards step in that history and a backwards animation. Interestingly, if you load a child page directly, the back button will trigger a forward animation.

More to the point of the thread, left/right page animations are closely tied to the tab bar directive in Ionic. If you want to animate between pages in a manner unlike its default behavior, you’ll likely have to roll your own. There’s some reusable bits to Ionic that you can use, but it would be a new thing (directive/service).

These are my findings, but I’m still pretty new to Ionic, so take it with a grain of salt.

The main issue is if you skip a navigation step the automatic animation based on history is wrong.
Eg. If you have an A -> B -> C navigation stack and you link directly to B from somewhere (skipping A), then going B -> A triggers a forward animation. which is very disorienting for the user.

@adam/@max: Any updates on this? In my app I sometimes have to jump back two or more steps in history, and afterwards the view transitions go in the wrong direction. Is there any way to reset/clear the history once the user gets back to the home screen in the app?


For cleaning history, see if any of these topics help:

1 Like

@jorgtron, it’s something we are working on right now. No answer just yet unfortunately, but it’s a higher priority.

Sorry I can’t be more concrete, we are still investigating why it’s happening sometimes and not other times.

1 Like

@jorgtron You might also want to look at this :


Your links aren’t getting the “back” animation you expect because they are links. Links mean go forward. So, a link can’t understand your intent to go backward.

Look at the code for the last page in the example. It uses the history to actually go back and provides the correct animation.


Thanks! I’ll check those out :smiley:

Thanks for the advice. I have a similar problem in which the step back is a logical one and not necessarily in the view history. I have a list and a detail view of a list element. Now I implemented in the detail view two fast navigation buttons (left and right) to change to the detail view of the previous list element respectively of the next list element without having to return to the list view. And the back button of the detail view always returns to the list view, not to the detail view last shown. I got all this working but not the back animaton for going to the previous list element. How can I do this?

You mind starting a new forum post and including a CodePen sample of what you’re trying to accomplish? Or at least a GIF showing what’s happening.

I also have this same problem.

A simplified journey use case:





then if the user wants to go back a page, I navigate them to:


However this transitions from left to right rather than right to left.

Any help would be appreciated. It’s crazy how jarring it looks when it is the wrong direction.

Hey @elliot, did you end up finding a way to set a direction for the animation to a specific state?

@mhartington or @Calendee maybe?

Negative, currently I’m carrying on with other development and hoping something comes from this thread in the mean time!

For the most part the transitions are fine apart from my bespoke back button where it tends to guess incorrectly that I’m going forward rather than back. In this case wherever I have this button I’d like to force a particular direction (such as right to left)

@coen_warmer, sorry for not getting back to you right away, seems like you’ve been active about this on github :smile:

1 Like

Yup @mhartington, glad to know it’s being worked on. Excited about all this new stuff that’s coming!

Just remember…

I had the same problem and i’ve come with the following solution:

In templates I made the following addition:

<ion-tabs class="tabs-icon-top slide-left-right" ng-class="{reverse:isReverse}">

In controller I registered the following listener to $stateChangeStart:

.controller('TabCtrl', function($scope, $state, $rootScope) {
   $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams){
        // determine the direction of the transition
	$rootScope.isReverse = <;	

It works ok so far.


is there any progress about setting the direction of page transitions manually ?


I would also like to know the answer to this.