ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Ionic 2 Page Transition slide right-to-left and slide-left-to-right

Open wrughony opened this issue 10 years ago • 12 comments

Short description of the problem:

Have page containing a navbar with 2 buttons A (Page 1) and B (Page2). Button A is situated from at right and Button B on the left. Button A navigates to Page 1 and Button B to Page 2,

By clicking, Button A it slides from left-to-right, to display Page 1. Returning back from Page 1 to Home Page, it's slides from right-to-left but doesn't go to the Home Page. ---> No error on console

By clicking, Button B it slides from right-to-left, to display Page 2. Returning back from Page 2 to Home Page, it's slides from left-to-right and goes to home page.

What behavior are you expecting?

The expected behavior is when I go from Home Page to Page 1, I click on button A there should be a slide transition from left-to-right and when returns back I should slide from right-to-left and the Home Page should be displayed

Steps to reproduce:

Using Plunker Link below:

  1. From Home Page click on button Page 1 (available in navBar)
  2. The Page will slide from left-to-right
  3. Then click back button (available in navBar), the page will slide from right-to-left
  4. But the page displayed is not the HomePage

I have used the following:

goToPage1( ) {
    this.nav.push(Page1,{},{animate: true, direction: 'back'});
}

and

goBack() {
    this._navController.pop({animate: true, direction: 'forward'})
}

Which Ionic Version? 2.x

Plunker that shows an example of your issue

Plunker Demo - http://plnkr.co/edit/byUHlM?p=preview

Project on Github that shows an example of your issue

Github Project - https://github.com/wrughony/IonicTest

Run ionic info from terminal/cmd prompt:

Your system information:

Cordova CLI: 6.2.0
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.33
Ionic App Lib Version: 2.0.0-beta.19
OS: Windows 7 SP1
Node Version: v4.3.0

wrughony avatar Jul 29 '16 07:07 wrughony

Hello! Thanks for opening an issue with us! As this seems like more of a support question i will urge that you ask this question on our forum (forum.ionicframework.com). Thanks for using Ionic!

jgw96 avatar Jul 29 '16 14:07 jgw96

The question was posted on ionic framework forum and someone replies confirming to have the same issue. it's seems that after a push with back direction a pop with forward direction doesnot work.

wrughony avatar Jul 29 '16 16:07 wrughony

hi , i am facing the same issue , any updates regarding this ??

YasirSherzad avatar Apr 08 '17 04:04 YasirSherzad

HI, I am also facing same issue, if any alternate solutions?

raghulrajnkl avatar Apr 20 '17 11:04 raghulrajnkl

@jgw96 Any updates on this issue ?

sherozejoomun avatar Apr 26 '17 08:04 sherozejoomun

This worked for me this.navCtrl.push(Page,{},{animate:true,animation:'transition',duration:500,direction:'forward'})

I am using ionic 3,cordova 6.5 and it worked.it only worked when i have set animation property to 'transition'.

I dont get it why id didn't work for 'md-transition' which is documented in ionic framework

anshuman-singh-93 avatar Jun 11 '17 06:06 anshuman-singh-93

The following works for me: this.navController.push(Page,{},{ animate: true, direction: 'back' });`

and to go back

this.navController.pop({animate: true, direction: 'forward'});

Ionic: 2.2.0

sherozejoomun avatar Jun 12 '17 12:06 sherozejoomun

@anshuman-singh-93 your solution worked for me...but how about going back?

yasir-netlinks avatar Jun 13 '17 06:06 yasir-netlinks

Thanks @anshuman-singh-93 your solution work. I had to set the animation to 'transition' too.

nolazybits avatar Jul 28 '17 05:07 nolazybits

Thanks @anshuman-singh-93 .. works for me too

Closing this issue :)

wrughony avatar Jul 31 '17 12:07 wrughony

This worked for me this.navCtrl.push(Page,{},{animate:true,animation:'ios-transition',duration:500,direction:'forward'}) this.navCtrl.pop({animate:true,animation:'ios-transition',duration:500,direction:'back'}) md-transition works up/down while ios-transition works left/right.

vinamjai avatar May 30 '18 10:05 vinamjai

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 01 '18 04:09 ionitron-bot[bot]