Oh never mind, just found an answer! For anyone who's interested:
in the DismissablePane class there's a parameter "confirmDismiss" where you can pass the function, and if you return false, the item stays in the list :)