How to disable drag in side menu

Haha, you’re asking me to give an example of the example I’ve given…?

Thanks Max! This really helped me!

Greetings from Amazon, Brazil, coen_warmer!

Your tip worked very well for me!

Thank you!

1 Like

Hello there. Is there any way to only have it draggable to one side? I have two side menus, one to the left of the content, and one to the right of the content. I want my app to not display the right side menu by dragging, only the left one.

I am having the same problem. Is there an easy way to solve this one?

Hi,
I am using side menu and menu content has ion-list. The ion-list has on-swipe-left as below:

ion-item ng-repeat="question in NewSurveyDetails.questionList"
class="item item-remove-animate calm-border"
type="item-text-wrap"
on-swipe-left=“NewSurveyDetails.deleteQuestion(question)”>

But when I swipe left, side menu opens. Swipe does not work for list item.

If I disable swipe on menu content using drag-content=“false”, but that disables swipe for entire content, hence swipe on list item still does not work.

How can I disable swipe for side-menu, but allow swipe on list item?

Thanks,
Prachi

worked as expected and thanks, will check for mobile support too…

Awesome answer… works fine for me… Thanks a lot…

It works. thank you :smile:

In one of my views, i am hiding the menu icon from the header but when i swipe the content area, the menu shows up. To fix this i used $ionicSideMenuDelegate.canDragContent(false) in that controller and it worked fine. But now when i navigate to a previous view where the menu icon is back visible, the sliding does not work. So do i have to write $ionicSideMenuDelegate.canDragContent(true) now in all the controllers where i want sliding to work? Or is there some mistake that i am making?

1 Like

Drag-content=“false” not working in mobile but it is working fine in browser

Just for the records. If anybody is trying whith drag-content="false" on your ion-side-menu, you need to remove it. Thanks!

then how to do this?

hey max can you help me… It is not working in ionic2

I meet same issue on Ionic 2.

Are there solution for ionic 2 ?

thank @max :smiley: it work

For Ionic 2 use http://ionicframework.com/docs/v2/api/components/menu/Menu/#swipeEnable

1 Like

For those who want to disable it for a specific view and enable it for the remaining views, put the following into your controller.

$scope.$on('$ionicView.afterEnter', function(event) {
            $ionicSideMenuDelegate.canDragContent(false);
        });
        //enable side menu drag before moving to next view
        $scope.$on('$ionicView.beforeLeave', function (event) {
            $ionicSideMenuDelegate.canDragContent(true);
        });
3 Likes

<side-menu-content drag-content="false">
is working Charm :slight_smile:thank you

1 Like

hey did you find a solution for this? I have the exact same problem