Reputation: 696
I am using two side menu in my ionic app i.e. on left and right side.
How can I disable dragging right menu only. I tried using $ionicSideMenuDelegate.canDragContent(false)
but it disables both side dragging.
HTML for ref
<ion-nav-bar>
<ion-nav-buttons side="left">
<button menu-toggle="left">
</button>
</ion-nav-buttons>
<ion-nav-buttons side="right">
<button menu-toggle="right">
</button>
</ion-nav-buttons>
</ion-nav-bar>
Upvotes: 2
Views: 1187
Reputation: 44659
How can I disable dragging right menu only.
IMPORTANT: The following answer works only in Ionic2/3.
You can use the swipeEnable(shouldEnable, menuId) method, but only in the right menu. Since you have only one menu on each side, instead of the id, we can use the side ('left'
or 'right'
).
import { MenuController, ... } from 'ionic-angular';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
constructor(private menuCtrl: MenuController, ...) {
this.menuCtrl.swipeEnable(false, 'right');
// ...
}
// ...
}
Upvotes: 3