I am using draggable and droppable features of jquery-ui.
I need to identify whether revert has happened.
Is it possible to trap whether “revert” has happened or not?
I am using draggable and droppable features of jquery-ui. I need to identify whether
Share
Feels a bit hacky, but a possible solution would be the following:
revert accepts a function, so we only return true, if the draggable is not accepted, for whatever reason.
Now to make this work, we have to add our .logRevert-class when an acceptable draggable is above the droppable. After it drops and doesn’t get reverted, it removes the helper-class .logRevert. You can now always add code to the return
Derived from Nick Craver’s answer on: jQuery draggable revert based on condition