In the Messages app on my iPhone 6, when I swipe left on an item, I can either swipe right to go back or tap on the item to go back. The ion-list option for swiping does not allow me to “TAP” to go back. I am forced to swipe right to go back.
@djett you’re awesome dude. Thanks for the quick reply, but your solution solves half of my problem. Basically from your pen, if I swipe left I see the Edit and Share and if I tap on the item it closes the ItemOptions. However, if I just tap on an item I need to open another template with subitems.
When I tap on an item: If ItemOptions are showing -> then close itemOptions. If ItemOptions are not showing, open subtemplate with sub items
@gigocabrera I updated the codepen with the logic on how you would accomplish this but… DISCLAIMER this should NOT be in the controller but should be in a directive I just don’t want the Angular gods to come down on me at this point ha!
I’ve been playing around with the ionic framework for a week and although I’ve been able to put together a tiny little app that connects to Firebase as a backend, this is WAAAAYYYY out of my league and I never thought my issue would be this complicated.
If you can point me in the right direction on how to make this happen I would greatly appreciate it!!!
cool no prob, I would start by reading the angular docs for directives here . Then after you get the hang of creating directives, you can port the controller code from the codepen (I updated it to do what you wanted it to do on my last post) over to the directive.
Since you are decorating behavior (click behavior) you’re better off creating an attribute directive rather than an element directive that can take a function. The directive can do exactly what the controller does, check for invisible class on the item-options container, and if not there, close the options, otherwsie invoke the passed in function from the isolated scope.
This will all make sense after reading the directive docs and playing with the examples