Ion-list ion-item swipe event not working


#1

My ion-list and its items look like this:

<ion-list show-delete="false" can-swipe="true" swipe-direction="both">
  <ion-item ng-repeat="item in list" on-hold="onHold()" on-swipe-left="onSwipeLeft()" on-swipe-right="onSwipeRight()">{{ item.label }}</ion-item>
</ion-list>

My onHold(), onSwipeLeft() and onSwipeRight() function look like this:

// On hold is working fine
$scope.onHold = function(item){
  console.log("hold");
  alert("hold");
}

// Never called
$scope.onSwipeLeft = function(item){
  console.log("swipe left");
  alert("swipe left");
}

// Never called
$scope.onSwipeRight = function(item){
  console.log("swipe right");
  alert("swipe right");
}

The funny thing is on-hold event works. It gets triggered and called when I pressed on the list item. So there isn’t a problem with gestures.

PROBLEM: However, the on-swipe-left event and on-swipe-right event for a list item never seem to trigger, no matter how big/small or fast/slow I swipe left and right i.e. onSwipeLeft() and onSwipeRight() never get called.

Are ion-item designed to respond to swipe gestures? I am confused as the swipe gestures are documented and I thought they are supported. Am I missing anything?


#2

http://embed.plnkr.co/XMFORE/


#3

I notice you set the gesture handlers for ion-content.

Can they be set on a ion-item instead?

If I set them on ion-content like you do, how do I detect which list item has been swiped?