When I swipe to the right, it pops the page I'm in


#1

Hello, I am looking for a way to disable the poping a page when I swipe to the right.

For example, if an app has two pages in a stack, – FirstPage you this.navCtrl.push(SecondPage) – then, by default, if you do a swipe gesture from the left to the right, it this.navCtrl.pop() the page automatically. I need that to stop. How can I do it?


#2

Set swipeBackEnabled on ion-nav.


#3

Thanks, I think it’s not very clear where to set the swipeBackEnabled in the docs. Could you please set an example code?


#4

In the template of your root component - it seems to be in a file called app.html now, it keeps changing - set

<ion-nav [root]="rootPage" [swipeBackEnabled]="false"></ion-nav>


#5

Thanks a lot! Works perfectly!