Skip to content

Commit fe83573

Browse files
author
Claudéric Demers
authored
Update statements to only rely on pageX/Y Offset
All of the browsers that support scrollX/Y already support pageXOffset and pageYOffset
1 parent 42721b5 commit fe83573

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/SortableContainer/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,8 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f
520520
y: offset.y - this.initialOffset.y,
521521
};
522522
// Adjust for window scroll
523-
translate.y -= ((window.scrollY || window.pageYOffset) - this.initialWindowScroll.top);
524-
translate.x -= ((window.scrollX || window.pageXOffset)- this.initialWindowScroll.left);
523+
translate.y -= (window.pageYOffset - this.initialWindowScroll.top);
524+
translate.x -= (window.pageXOffset - this.initialWindowScroll.left);
525525

526526
this.translate = translate;
527527

@@ -571,8 +571,8 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f
571571
top: this.offsetEdge.top + this.translate.y + deltaScroll.top,
572572
};
573573
const scrollDifference = {
574-
top: ((window.scrollY || window.pageYOffset) - this.initialWindowScroll.top),
575-
left: ((window.scrollX || window.pageXOffset) - this.initialWindowScroll.left),
574+
top: (window.pageYOffset - this.initialWindowScroll.top),
575+
left: (window.pageXOffset - this.initialWindowScroll.left),
576576
};
577577
this.newIndex = null;
578578

0 commit comments

Comments
 (0)