How can I make the parent div draggable, yet keep the text in the child span selectable?
<aside draggable="true" id="dragme">
This is an aside, drag me. <span id="copyme" draggable="false">But copy me!</span>
</aside>
A similar question has been asked here, but I'm looking for a solution using only HTML5, without jQuery.
I've attempted to prevent the drag event, but so far I haven't been successful without affecting text selection:
function dontdrag(ev) {
ev.preventDefault();
ev.stopPropagation();
ev.stopImmadiatePropagation();
return false;
}
Here is a fiddle demonstrating the issue: http://jsfiddle.net/lborgman/8NvAT/6/
Is there a solution to this problem?
UPDATE: There might be a potential solution in the updated fiddle: http://jsfiddle.net/lborgman/8NvAT/7/
It's not perfect, but it seems to work. Any suggestions on improving this solution further?