Sliding item to close when user stops dragging

What I want to do is, when option buttons in the item sliding are disabled, the item should be still draggable to show the disabled buttons, but when the user lets go of the item that is being dragged, it should snap back and close the option buttons.

An effect similar to this example - http://ionicframework.com/docs/v2/api/components/item/ItemSliding/

In the example when you drag the item to the right it will show the archive button, but will snap back to close it when you let go. In this example there is a case where you slide and the archive button stays open too. But that shouldn’t happen in my case. It should close.

How do I achieve this effect?