Side Menu in Ionic 2 to be opened permanently when

2019-09-11 14:49发布

问题:

In Ionic 2. I have disabled the closing of side menu while selecting the menu item with commenting this.menu.close() in openPage(). but when I'm clicking or tapping on outside the side menu the side menu is closing. I need the side menu to be opened when resolution is more than 768px.

But when tapping or clicking outside the side menu closes the side menu.

How can I prevent the closing of side menu when tapping or clicking outside the side menu in Ionic 2?

回答1:

I am not sure you can do this straightforwardly. What I would do to have this behavior is to use a component wrapper inside the menu content and use this same wrapper inside the <ion-content> if the resolution is higher than some value (with an *ngIf).

Could it be convenient in your case?

EDIT : I posted an example of what I proposed in this thread.