4 ms·
There is already `e.preventDefault()` happening on the events, so for example when you drag on a touchscreen it would normally scroll the page - but after invok
by err4nt 11y ago
There is already `e.preventDefault()` happening on the events, so for example when you drag on a touchscreen it would normally scroll the page - but after invoking this it won't do that.
What I'm not sure how to do is block other things on the page specifically also set to happen on the same events.
On a desktop web browser playing around with this I've had success hammering on the Esc key while moving links though. If you press Esc right after releasing most links it won't leave the page :)
- nkrisc 11y agoI managed to alleviate most of the problem by adding a new click event listener that `e.preventDefault()` to every target of the drag event. It's kinda clunky but it works for anchor tags. Doesn't work if the element uses JS for navigation/showing a modal/etc. I figure effectively disabling everything you drag doesn't really matter as dragging stuff around kinda FUBARs the page anyway.