Disable swipe on specific slide


#1

Hello I want to disable the swipe on only one slide. In case the second slide

I want disable swipe on only second slide because when I moving the map it makes me change slides.

But when I use this.slides.lockSwipes(true); it disable swipe on all slide…

And I would like disable swipe on the second slide but that the button Next still works.

Thanks in advance ! :slight_smile:


#2

Please no one has the solution to my problem?


#3

Try to use the this.slides.lockSwipes(true); method in ionViewWillEnter() to lock them and this.slides.lockSwipes(false); in ionViewWillLeave() to unlock them within the page with the map.


#4

Thanks but I work with 4 slides and I want to desable swipe on only one slide, no all slides. ionViewWillEnter() runs when the page is about to enter and become the active page


#5

Oh ofcourse, my mistake. I thought the slides were different pages.


#6

No I have 4 slides, here is my problem lol


#7

I can’t try it myself atm but you could check: https://stackoverflow.com/questions/43229873/ionic-2-how-to-prevent-page-changes-on-ion-slides-by-swipe-gesture/43231343


#8

Thank you it work ! :slight_smile: