# Detecting if an item is swiped open?

**URL:** <https://forum.ionicframework.com/t/detecting-if-an-item-is-swiped-open/18257>\
**Category:** uncategorized\
**Created:** [February 25, 2015, 8:02pm UTC](https://forum.ionicframework.com/t/detecting-if-an-item-is-swiped-open/18257 "2015-02-25T20:02:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RangerRick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rangerrick/32/8163_2.png) [@RangerRick](https://forum.ionicframework.com/u/RangerRick)\
**Post date:** [February 25, 2015, 8:02pm UTC](https://forum.ionicframework.com/t/detecting-if-an-item-is-swiped-open/18257/1 "2015-02-25T20:02:01Z")

</div>

I have an ion-list of items which I have opening a modal if `ng-click`ed. However, I’ve also got option buttons on these items. Is it possible to easily detect whether the item is open or not when handling the `ng-click`, so that if the option buttons are visible, it will call `$ionicListDelegate.closeOptionButtons()` rather than the `ng-click` action?

ie:

item is closed: tap opens modal details  
item is swiped open: tap closes the item/hides the option buttons

---

<div class="post-metadata">

**Author:** ![latorril](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/latorril/32/95800_2.png) [@latorril](https://forum.ionicframework.com/u/latorril)\
**Post date:** [January 28, 2016, 8:59am UTC](https://forum.ionicframework.com/t/detecting-if-an-item-is-swiped-open/18257/2 "2016-01-28T08:59:10Z")

</div>

Is there an answer to this?

---

<div class="post-metadata">

**Author:** ![vicmota](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vicmota/32/96232_2.png) [@vicmota](https://forum.ionicframework.com/u/vicmota)\
**Post date:** [January 28, 2016, 8:27pm UTC](https://forum.ionicframework.com/t/detecting-if-an-item-is-swiped-open/18257/3 "2016-01-28T20:27:15Z")

</div>

The $ionicListDelegate doesn’t offer any methods for checking this. You can do it in two hacky ways:  
By checking if the option buttons container has the class ‘invisible’ on it (might be hard).  
By modifying the Ionic core source code (not recommended, though), so you can just expose and check the `_lastDragOp` field from the listView controller. It’s `null` if the option buttons are closed.

---

<div class="post-metadata">

**Author:** ![mtpultz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mtpultz/32/83033_2.png) [@mtpultz](https://forum.ionicframework.com/u/mtpultz)\
**Post date:** [April 22, 2016, 8:13pm UTC](https://forum.ionicframework.com/t/detecting-if-an-item-is-swiped-open/18257/4 "2016-04-22T20:13:43Z")

</div>

+1 adding this to the $ionicListDelegate so we know when one of the list items has been swiped open. This has come up a couple times for us now 😢
