dragon icon indicating copy to clipboard operation
dragon copied to clipboard

Clicking to drag items triggers the behavior of the clicked elements

Open zhouzi opened this issue 9 years ago • 1 comments

When press mouse down to drag an element, the behavior of the clicked element is triggered. Which might end up in submitting a form, opening a dropdown, ... I think it'd be cool to prevent that.

P.S: Great job with dragon.js, that's definitely something that designers are going to love. I'm giving it a try and wanted to raise some of the issues I faced - I might contribute too ^^

zhouzi avatar Feb 19 '16 08:02 zhouzi

Hi @Zhouzi, originally (and in the version visible in the Youtube video) tapping things like links sometimes clicked them, but since then I have added:

document.addEventListener("click",function(e){e.preventDefault()})

...which should block this behavior. If you have an outdated bookmark you'll have to replace it with the newer version. If you just want to quickly test if the new version works, check out http://staticresource.com/dragon/ and try to click on the purple link to dragon.js in that second paragraph to test if clicking links is prevented. Dragon is loaded on the test page so you don't need to run the bookmarklet to drag things around on this page.

Hope this helps, thanks for your interest :D

tomhodgins avatar Feb 19 '16 08:02 tomhodgins