Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit 8d53491

Browse files
committed
🚑 Hotfix draggable modal windows with touch
1 parent 2805f1d commit 8d53491

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/classes/modal.class.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ class Modal {
133133
function modalTouchmoveHandler(e) {
134134
draggedModal.posX = draggedModal.posX + (e.changedTouches[0].clientX - draggedModal.lastMouseX);
135135
draggedModal.posY = draggedModal.posY + (e.changedTouches[0].clientY - draggedModal.lastMouseY);
136-
draggedModal.lastMouseX = e.clientX;
137-
draggedModal.lastMouseY = e.clientY;
136+
draggedModal.lastMouseX = e.changedTouches[0].clientX;
137+
draggedModal.lastMouseY = e.changedTouches[0].clientY;
138138

139139
draggedModal.setAttribute("style", `${draggedModal.zindex}background: rgba(var(--color_r), var(--color_g), var(--color_b), 0.5);left: ${draggedModal.posX}px;top: ${draggedModal.posY}px;`);
140140
}

0 commit comments

Comments
 (0)