Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when cursor goes beyond top or left of document while dragging #47

Open
OvervCW opened this issue Apr 12, 2023 · 0 comments
Open

Comments

@OvervCW
Copy link

OvervCW commented Apr 12, 2023

When you drag an element with the v-drag attribute everything works fine until the cursor (not the element) touches the left side or top side of the document. When that happens, the following exception is raised:

image

When the cursor is touching the top (or beyond it), dragging does continue to work, but when the cursor is touching the left side, the position of the element stops updating until the cursor moves back into the document.

I would guess that the fault lies within these lines:

// Update value of the mouse position
window.data.mouseX = (e.pageX || e.touches[0].pageX) - window.data.initialX;
window.data.mouseY = (e.pageY || e.touches[0].pageY) - window.data.initialY;

Where e.touches is undefined.

@OvervCW OvervCW changed the title Exception when cursor touches top or left of document while dragging Exception when cursor goes beyond top or left of document while dragging Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant