[SOLVED] How to prevent swiping from left to right on a page to go back?

Hello,

in my app i’ve just noticed that if i’m on a page and i swipe with my finger from left to right, the app goes back to the previous page.

There is a way to prevent this?

I don’t want any swipe action on certain pages because it breaks the app behavior.

in the following video you can see what happens

Video

thank yo so much!

my project specs:

Ionic:

Ionic CLI : 6.16.3 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.3.1
@angular-devkit/build-angular : 0.803.26
@angular-devkit/schematics : 8.3.26
@angular/cli : 8.3.26
@ionic/angular-toolkit : 2.3.3

Capacitor:

Capacitor CLI : 2.4.1
@capacitor/android : 2.4.1
@capacitor/core : 2.4.1
@capacitor/ios : 2.4.1

SOLVED using IonicModule.forRoot({
swipeBackEnabled: false
}),

1 Like

write this in your app.module.ts
IonicModule.forRoot({ swipeBackEnabled: false }),

1 Like