diff --git a/package.json b/package.json index e18d56d..051b315 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "drag-timetable", - "version": "1.0.9", + "version": "1.0.10", "description": "Simple, customizable draggable timetable.", "main": "dist/app.js", "scripts": { diff --git a/src/drag.js b/src/drag.js index 5e0805c..a37a0dd 100644 --- a/src/drag.js +++ b/src/drag.js @@ -46,7 +46,8 @@ class TimetableDraggable { this.currentGhostElement.style.left = (ev.pageX - this.startOffsetX) + "px"; this.currentGhostElement.style.top = (ev.pageY - this.startOffsetY) + "px"; } - this.dragManager.spacer.moveUpdate(ev.pageY - this.startOffsetY - document.documentElement.scrollTop, this.taskId); + const scrollOffset = window.pageYOffset || document.documentElement.scrollTop; + this.dragManager.spacer.moveUpdate(ev.pageY - this.startOffsetY - scrollOffset, this.taskId); } } }