Skip to content

Commit cb07a80

Browse files
author
Adam Zielinski
committed
Fixed calculation of "a special case where we need to modify a offset calculated on start"
It was altering parentOffset under wrong condition - scrollParent was compared to document instead of document.body
1 parent e6360ab commit cb07a80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui/jquery.ui.sortable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ $.widget("ui.sortable", $.ui.mouse, {
954954
// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
955955
// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
956956
// the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
957-
if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
957+
if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && this.scrollParent[0] !== document.body && $.contains(this.scrollParent[0], this.offsetParent[0])) {
958958
po.left += this.scrollParent.scrollLeft();
959959
po.top += this.scrollParent.scrollTop();
960960
}

0 commit comments

Comments
 (0)