Ignat
Ignat

Reputation: 3787

How to remove drag function from ion-menu?

I'm using ionic 2 and I want to know how to remove drag function from ion-menu ?

Upvotes: 4

Views: 1379

Answers (5)

Chris Rae
Chris Rae

Reputation: 5675

For Ionic 1, look for:

<ion-pane ion-side-menu-content>

and change it to:

<ion-pane ion-side-menu-content drag-content="false">

(I know someone else attempted to answer for Ionic 1 already, but it wasn't very clear at all).

Upvotes: 0

varun aaruru
varun aaruru

Reputation: 2940

In ionic 2:

ionViewDidEnter() {
    this.menu.swipeEnable(false);
  }

check this swipeEnable(shouldEnable, menuId) from ionic v2 docs

In ionic 1: refer to this codepen

Upvotes: 6

Valentin Blokhin
Valentin Blokhin

Reputation: 515

In ionic 2 beta 9, you can add [swipeEnabled]="false" in html.

<ion-menu [swipeEnabled]="false">
</ion-menu>

Upvotes: 1

In your ion-menu add: swipeEnabled="false" directive, that would do.

Upvotes: 0

Maksim
Maksim

Reputation: 2466

this.app.getComponent('leftMenu').isSwipeEnabled = false;

Upvotes: 1

Related Questions