Revert draggable item after it has been dropped

Revert draggable item after it has been dropped

I have a situation where certain items dropped are mutually exclusive with each other. If one is dropped, I need to check for the others and revert them to their draggable container. I've tried a number of approaches but nothing has worked yet. Online search only showed how to set up the revert function, but I didn't find anything that met this specific need. Here is what I need to occur:

1. User drops a draggable item onto a droppable item.
2. Droppable item is checked for the mutually exclusive draggable items.
3. Any such draggable items (except for the one currently being dropped) are reverted back to the draggable container.

I've tried setting the revert to true in the droppable's "drop" event, but this failed. I also tried setting it as part of the revert function that is assigned to the draggable items, but didn't have any luck with that, either.