0

I want to disable swipe-right event on the ion-list. There is a can-swipe="true" directive in ionic, but isn't there a directive like can-swipe-right="false" that would allow me to disable the swipe right event on ion-list? Here is the snippet of my code:

<ion-list show-delete="false" can-swipe="true">
<ion-item ng-repeat="listing in listings">
   <p>{{listing.title}}</p>
   <ion-option-button class="button-light ion-heart" ng-click="addToFavorites(listing)"></ion-option-button>
 </ion-item>
</ion-list> 

1 Answer 1

1

can-swipe="false" should work on ion-list but not on ion-item.

It should execute $ionicListDelegate.canSwipeItems(false);

FYI: https://github.com/driftyco/ionic/blob/master/js/angular/directive/list.js#L158

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer, Jefferson. Actually, I only wanted the list to not swipe in the 'right' direction and only want the list to swipe to the left.I wanted something like can-swipe-right="false" . How do I do this? Any idea?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.