-
Hello, I have a draggable element inside the scroll, and when I try to drag the element on mobile, I expect the scroll will not move, but it does. How can I stop scrolling when I'm dragging the item? |
Beta Was this translation helpful? Give feedback.
Answered by
idiotWu
Jan 22, 2022
Replies: 1 comment 1 reply
-
Try calling draggableEl.addEventListener('touchmove', e => {
e.preventDefault();
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dellyn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try calling
preventDefault()
on touchmove/pointermove events (depending on which event you are listening to), for example: