Sidemenu Drag


#1

We are currently trying to migrate our app from a pure Angular app to Ionic. Before we used the snap.js sidemenu
which had the nice porperty that you could include

data-snap-ignore="false"

in some elements to ignore the sidemenu drag when dragging the element.

We have such elements inside our app where we need dragging interaction and with Ionic it interferes with the sidemenu dragging.

What are best practices in Ionic to solve this issue?


#2

I solved those things with:
http://ionicframework.com/docs/api/service/$ionicSideMenuDelegate/

There is the canDragContent() - function where you can set if sidemenu is opening by dragging.

Put touchstart, touchend, touchcancel listeners on those events:
touchstart -> set canDragContent to false
touchend / touchcance -> set canDragContent to true.

Very helpful for vertical and horizontal scroll issues ;).

Bestway is to build a small directive -> so you get the jqlite element and can easily add those handlings on every dom-node you want.


#3

Thanks. Although I liked the approach of snap.js more I could solve the issue with your help.