Programmatically Hide ion-option-button?

We are using the option buttons to give the users the ability to remove items from the list. After clicking the option button, we confirm the removal request. If they don’t confirm it, they end up back at the list and the option buttons are still showing for the item.

Is there any way to programmatically hide those? Didn’t see anything in the docs.

Yup, this is possible. Check out the docs for List delate

http://ionicframework.com/docs/api/service/$ionicListDelegate/

closeOptionButtons()

5 Likes

Hi @mhartington,
If i use different list in one page with each list have some Option button,
Is there any way to prevent Option-Button to show while the other in another card is showing?

I mean the problem is like this pict :
http://www.nanonimos.com/IonOption.jpg

Here’s my codepen : http://codepen.io/harked/pen/WvMgXg

Well this happens because each ion-list creates it’s own scope, so they get isolated from each other. Off the top of my head, you could use root scope, but I haven’t tested it. But I don’t think you’d need to use two ion-list.

If you need the css, you could just use div.list instead of two ion-list.