@@ -571,13 +571,29 @@ $.ui.plugin.add("draggable", "connectToSortable", {
571571
572572 $ . each ( inst . sortables , function ( i ) {
573573
574+ var innermostIntersecting = false ;
575+ var thisSortable = this ;
574576 //Copy over some variables to allow calling the sortable's native _intersectsWith
575577 this . instance . positionAbs = inst . positionAbs ;
576578 this . instance . helperProportions = inst . helperProportions ;
577579 this . instance . offset . click = inst . offset . click ;
578580
579581 if ( this . instance . _intersectsWith ( this . instance . containerCache ) ) {
582+ innermostIntersecting = true ;
583+ $ . each ( inst . sortables , function ( ) {
584+ this . instance . positionAbs = inst . positionAbs ;
585+ this . instance . helperProportions = inst . helperProportions ;
586+ this . instance . offset . click = inst . offset . click ;
587+ if ( this != thisSortable
588+ && this . instance . _intersectsWith ( this . instance . containerCache )
589+ && $ . ui . contains ( thisSortable . instance . element [ 0 ] , this . instance . element [ 0 ] ) )
590+ innermostIntersecting = false ;
591+ return innermostIntersecting ;
592+ } ) ;
593+ }
594+
580595
596+ if ( innermostIntersecting ) {
581597 //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
582598 if ( ! this . instance . isOver ) {
583599
0 commit comments