@@ -35,7 +35,7 @@ import {
3535 scrollBy ,
3636 clone ,
3737 expando ,
38- getContentRect
38+ getChildContainingRectFromElement
3939} from './utils.js' ;
4040
4141
@@ -1790,22 +1790,22 @@ function _unsilent() {
17901790
17911791function _ghostIsFirst ( evt , vertical , sortable ) {
17921792 let firstElRect = getRect ( getChild ( sortable . el , 0 , sortable . options , true ) ) ;
1793- const sortableContentRect = getContentRect ( sortable . el ) ;
1793+ const childContainingRect = getChildContainingRectFromElement ( sortable . el , sortable . options , ghostEl ) ;
17941794 const spacer = 10 ;
17951795
17961796 return vertical ?
1797- ( evt . clientX < sortableContentRect . left - spacer || evt . clientY < firstElRect . top && evt . clientX < firstElRect . right ) :
1798- ( evt . clientY < sortableContentRect . top - spacer || evt . clientY < firstElRect . bottom && evt . clientX < firstElRect . left )
1797+ ( evt . clientX < childContainingRect . left - spacer || evt . clientY < firstElRect . top && evt . clientX < firstElRect . right ) :
1798+ ( evt . clientY < childContainingRect . top - spacer || evt . clientY < firstElRect . bottom && evt . clientX < firstElRect . left )
17991799}
18001800
18011801function _ghostIsLast ( evt , vertical , sortable ) {
18021802 const lastElRect = getRect ( lastChild ( sortable . el , sortable . options . draggable ) ) ;
1803- const sortableContentRect = getContentRect ( sortable . el ) ;
1803+ const childContainingRect = getChildContainingRectFromElement ( sortable . el , sortable . options , ghostEl ) ;
18041804 const spacer = 10 ;
18051805
18061806 return vertical ?
1807- ( evt . clientX > sortableContentRect . right + spacer || evt . clientY > lastElRect . bottom && evt . clientX > lastElRect . left ) :
1808- ( evt . clientY > sortableContentRect . bottom + spacer || evt . clientX > lastElRect . right && evt . clientY > lastElRect . top ) ;
1807+ ( evt . clientX > childContainingRect . right + spacer || evt . clientY > lastElRect . bottom && evt . clientX > lastElRect . left ) :
1808+ ( evt . clientY > childContainingRect . bottom + spacer || evt . clientX > lastElRect . right && evt . clientY > lastElRect . top ) ;
18091809}
18101810
18111811function _getSwapDirection ( evt , target , targetRect , vertical , swapThreshold , invertedSwapThreshold , invertSwap , isLastTarget ) {
@@ -1944,23 +1944,23 @@ if (documentExists) {
19441944
19451945// Export utils
19461946Sortable . utils = {
1947- on : on ,
1948- off : off ,
1949- css : css ,
1950- find : find ,
1947+ on,
1948+ off,
1949+ css,
1950+ find,
19511951 is : function ( el , selector ) {
19521952 return ! ! closest ( el , selector , el , false ) ;
19531953 } ,
1954- extend : extend ,
1955- throttle : throttle ,
1956- closest : closest ,
1957- toggleClass : toggleClass ,
1958- clone : clone ,
1959- index : index ,
1954+ extend,
1955+ throttle,
1956+ closest,
1957+ toggleClass,
1958+ clone,
1959+ index,
19601960 nextTick : _nextTick ,
19611961 cancelNextTick : _cancelNextTick ,
19621962 detectDirection : _detectDirection ,
1963- getChild : getChild
1963+ getChild
19641964} ;
19651965
19661966
0 commit comments