diff --git a/ui/widgets/droppable.js b/ui/widgets/droppable.js index 89bff2511b7..3aabd957dc0 100644 --- a/ui/widgets/droppable.js +++ b/ui/widgets/droppable.js @@ -420,7 +420,9 @@ $.ui.ddmanager = { if ( parent.length ) { parentInstance = $( parent[ 0 ] ).droppable( "instance" ); - parentInstance.greedyChild = ( c === "isover" ); + parentInstance.greedyChild = + ( typeof parentInstance.movedIntoGreedyChildInthisLoop !== "undefined" ) || + ( c === "isover" ); } } @@ -428,18 +430,18 @@ $.ui.ddmanager = { if ( parentInstance && c === "isover" ) { parentInstance.isover = false; parentInstance.isout = true; + parentInstance.movedIntoGreedyChildInthisLoop = true; parentInstance._out.call( parentInstance, event ); } this[ c ] = true; this[ c === "isout" ? "isover" : "isout" ] = false; this[ c === "isover" ? "_over" : "_out" ].call( this, event ); + } ); - // We just moved out of a greedy child - if ( parentInstance && c === "isout" ) { - parentInstance.isout = false; - parentInstance.isover = true; - parentInstance._over.call( parentInstance, event ); + $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() { + if ( typeof this.movedIntoGreedyChildInthisLoop !== "undefined" ) { + delete this.movedIntoGreedyChildInthisLoop; } } );