How to disable the swipe in ion-menu


#1

I read the docs but I can’t still figure it out :’(

I tried this in the app constructor like so:

this.menu = menu;
this.menu.swipeEnable(false);

and some other things but no luck…


#2

According to the docs, that seems correct ion-menu Perhaps the param might work on the element? shouldEnable=“false”


#3

Ok I tried this like two times and it never worked. I think I know what’s wrong with it. I am going to try it on my device and check.


#4

Does emulating a device in the browser (for example chrome offers this option) make a difference?


#5

I’ve emulated on the browser only. But I don’t see how will that affect of it was on the device or a browser because that’s the TS code and not any of the CSS or HTML


#6

I do not know the internal code but it could be that they only trigger certain behavior if a piece of code is being run on a mobile phone / tablet instead of desktop. Better save than sorry


#7

Just tried it on my 2 in 1 pc, does the same. And the emulators I used it does the same too. I tried it on a Android and Windows touch screens devices and it does the same.

:frowning:


#8

mike help me with that on slack.

here is the link.

Basically use a @ViewChild on the ion-menu using the id as the ‘identifier’


#9

How can i disable the side for only a single page ?
For instance Login Page .
Then i need to enable the menu for other page,
How to do it in Ionic 2. This is very annoying problem in ionic 2.
Please someone help me …