Disable swipeback on selected pages

Hello, what is the recommended way to disable swipe back navigation on some pages? I just know how to disable it for whole app which is not what I need.

I found the answer - add this to screen ionViewWillEnter

const nav = document.querySelector('ion-router-outlet') as  HTMLIonRouterOutletElement;
nav.swipeGesture = false;

Dont forget to set the swipeGesture to true when leaving the page.

1 Like