# Disable swipeback on selected pages

**URL:** <https://forum.ionicframework.com/t/disable-swipeback-on-selected-pages/204558>\
**Category:** Ionic Vue\
**Created:** [February 10, 2021, 6:44pm UTC](https://forum.ionicframework.com/t/disable-swipeback-on-selected-pages/204558 "2021-02-10T18:44:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakubkoje](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@jakubkoje](https://forum.ionicframework.com/u/jakubkoje)\
**Post date:** [February 10, 2021, 6:44pm UTC](https://forum.ionicframework.com/t/disable-swipeback-on-selected-pages/204558/1 "2021-02-10T18:44:07Z")

</div>

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.  
Thanks

---

<div class="post-metadata">

**Author:** ![jakubkoje](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@jakubkoje](https://forum.ionicframework.com/u/jakubkoje)\
**Post date:** [February 12, 2021, 10:59pm UTC](https://forum.ionicframework.com/t/disable-swipeback-on-selected-pages/204558/2 "2021-02-12T22:59:59Z")

</div>

I found the answer - add this to screen ionViewWillEnter

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

```

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