Skip to content

Commit e620122

Browse files
committed
added window.pageYOffset and window.pageXOffset to updatePosition and animationNode functions as fixes for IE 11
1 parent 6b6e2be commit e620122

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/SortableContainer/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f
283283
]; // Convert NodeList to Array
284284

285285
clonedFields.forEach((field, index) => {
286-
if (field.type !== 'file' && fields[index]) {
286+
if (field.type !== 'file' && fields[index]) {
287287
field.value = fields[index].value;
288288
}
289289
});
@@ -513,15 +513,15 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f
513513

514514
updatePosition(e) {
515515
const {lockAxis, lockToContainerEdges} = this.props;
516-
516+
517517
const offset = this.getOffset(e);
518518
const translate = {
519519
x: offset.x - this.initialOffset.x,
520520
y: offset.y - this.initialOffset.y,
521521
};
522522
// Adjust for window scroll
523-
translate.y -= (window.scrollY - this.initialWindowScroll.top);
524-
translate.x -= (window.scrollX - this.initialWindowScroll.left);
523+
translate.y -= (window.scrollY - this.initialWindowScroll.top) || window.pageYOffset;
524+
translate.x -= (window.scrollX - this.initialWindowScroll.left) || window.pageXOffset;
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 - this.initialWindowScroll.top),
575-
left: (window.scrollX - this.initialWindowScroll.left),
574+
top: (window.scrollY - this.initialWindowScroll.top) || window.pageYOffset,
575+
left: (window.scrollX - this.initialWindowScroll.left) || window.pageXOffset,
576576
};
577577
this.newIndex = null;
578578

0 commit comments

Comments
 (0)