@@ -267,7 +267,6 @@ export default function sortableContainer(
267
267
left : this . scrollContainer . scrollLeft ,
268
268
top : this . scrollContainer . scrollTop ,
269
269
} ;
270
-
271
270
this . initialWindowScroll = {
272
271
left : window . pageXOffset ,
273
272
top : window . pageYOffset ,
@@ -673,22 +672,17 @@ export default function sortableContainer(
673
672
return new Promise ( ( resolve ) => {
674
673
const { dropAnimationDuration, dropAnimationEasing} = this . props ;
675
674
const { containerScrollDelta, windowScrollDelta} = this ;
676
- const nodes = this . manager . getRefs ( ) ;
677
- const { edgeOffset : oldOffset , node : oldNode } = nodes [ this . index ] ;
678
- const { edgeOffset : newOffset , node : newNode } = nodes [ this . newIndex ] ;
675
+ const oldOffset = this . offsetEdge ;
676
+ const { edgeOffset : newOffset , node : newNode } = this . manager . nodeAtIndex (
677
+ this . newIndex ,
678
+ ) ;
679
679
const deltaX =
680
680
this . newIndex > this . index
681
- ? newOffset . left -
682
- oldNode . offsetWidth +
683
- newNode . offsetWidth -
684
- oldOffset . left
681
+ ? newOffset . left - this . width + newNode . offsetWidth - oldOffset . left
685
682
: newOffset . left - oldOffset . left ;
686
683
const deltaY =
687
684
this . newIndex > this . index
688
- ? newOffset . top -
689
- oldNode . offsetHeight +
690
- newNode . offsetHeight -
691
- oldOffset . top
685
+ ? newOffset . top - this . height + newNode . offsetHeight - oldOffset . top
692
686
: newOffset . top - oldOffset . top ;
693
687
694
688
setTranslate3d ( this . helper , {
0 commit comments