jqueryjquery-uijquery-draggablejquery-droppable

How does jquery draggable revert and droppable.drop function play together


I have seen multiple different behaviors in my code (due to a bug maybe) how the draggable revert function works together with the droppable drop event.

So I need clarification.

My expectation is that the revert function is called FIRST before the drop event.

Depending on the value of revert() function:

return true // does not fire the drop event because the drop is reverted...

return false // does fire the drop event

Can someone pro please tell me wether my assumption is right, because my code is not behaving like that.

The code is too much to post here, sorry can`t post.


Solution

  • The two are unrelated.

    When you mouseup your draggable over a droppable, the first thing that's called is the droppable's accept option (if it's a function, or just matched if a selector). Based on this you'll get two outcomes: