# Disable drag on right menu but not the left menu

**URL:** <https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449>\
**Category:** ionic-v1\
**Created:** [January 10, 2015, 12:56pm UTC](https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449 "2015-01-10T12:56:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whiff](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@Whiff](https://forum.ionicframework.com/u/Whiff)\
**Post date:** [January 10, 2015, 12:56pm UTC](https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449/1 "2015-01-10T12:56:17Z")

</div>

I have 2 menus, left and right. On the start view I want both menus to be swipe/draggable. But on all other views I don’t want the right menu to be draggable. Using $ionicSideMenuDelegate Im only able to disable both menus with canDragContent(false);

What’s the Ionic way to accomplish this?

---

<div class="post-metadata">

**Author:** ![devqon1](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@devqon1](https://forum.ionicframework.com/u/devqon1)\
**Post date:** [January 10, 2015, 2:21pm UTC](https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449/2 "2015-01-10T14:21:19Z")

</div>

To achieve this you’ll have to use the `$getByHandle`:

```
<ion-side-menu side="right" delegate-handle="right-menu">
</ion-side-menu>

```

In your controller:

```
$ionicSideMenuDelegate.$getByHandle('right-menu').canDragContent(false);
```

---

<div class="post-metadata">

**Author:** ![Whiff](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@Whiff](https://forum.ionicframework.com/u/Whiff)\
**Post date:** [January 10, 2015, 4:05pm UTC](https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449/3 "2015-01-10T16:05:10Z")

</div>

> [@devqon1](#):
>
> delegate-handle=“right-menu”

I can’t get it to work with $getByHandle.

```
Delegate for handle "right-menu" could not find a corresponding element with delegate-handle="right-menu"! canDragContent() was not called!
Possible cause: If you are calling canDragContent() immediately, and your element with delegate-handle="right-menu" is a child of your controller, then your element may not be compiled yet. Put a $timeout around your call to canDragContent() and try again. 

```

If I put delegate-handle directive in ion-side-menus instead of ion-side-menu this message don’t occur but it doesn’t help me disable only the right menu.

What am I doing wrong?  
https://codepen.io/whiffdev/embed/preview/EaZROY?default-tabs=html%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=EaZROY

---

<div class="post-metadata">

**Author:** ![devqon1](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@devqon1](https://forum.ionicframework.com/u/devqon1)\
**Post date:** [January 12, 2015, 9:26am UTC](https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449/4 "2015-01-12T09:26:51Z")

</div>

It seems like the `delegate-handle` is meant for the parent `<ion-side-menus>`, so I’m not sure how you can target only one menu within that instance.

---

<div class="post-metadata">

**Author:** ![cuaroc](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@cuaroc](https://forum.ionicframework.com/u/cuaroc)\
**Post date:** [February 27, 2015, 9:49am UTC](https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449/5 "2015-02-27T09:49:35Z")

</div>

hello there, right now I am developing an app using ionic and it would really be a lot of help if there is an existing way to easily solve this now? thanks in advance.

---

<div class="post-metadata">

**Author:** ![yaryk](https://avatars.discourse-cdn.com/v4/letter/y/5f9b8f/32.png) [@yaryk](https://forum.ionicframework.com/u/yaryk)\
**Post date:** [July 7, 2015, 9:08am UTC](https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449/6 "2015-07-07T09:08:14Z")

</div>

Hi guys,  
any update about this?

---

<div class="post-metadata">

**Author:** ![Whiff](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@Whiff](https://forum.ionicframework.com/u/Whiff)\
**Post date:** [July 8, 2015, 6:35pm UTC](https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449/7 "2015-07-08T18:35:31Z")

</div>

nope sorry 😔

---

<div class="post-metadata">

**Author:** ![Wllc](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@Wllc](https://forum.ionicframework.com/u/Wllc)\
**Post date:** [November 2, 2015, 11:55am UTC](https://forum.ionicframework.com/t/disable-drag-on-right-menu-but-not-the-left-menu/15449/8 "2015-11-02T11:55:15Z")

</div>

Hi!

A possible solution is use on-drag-left=“foo()” in .

I say this:

With foo function:  
$scope.foo = function ()  
if(you stay in start view)  
{  
$ionicSideMenuDelegate.canDragContent(true);  
}  
else  
{  
$ionicSideMenuDelegate.canDragContent(false);  
}

You must check in the function that view are you in each moment.

Best regards!
