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

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?

Set swipeBackEnabled on ion-nav.

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

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>

1 Like

Thanks a lot! Works perfectly!