Reputation: 344
I have a list of two droppable boxes where the items can be moved from one box to the other. Now I would like to make it moveable via a handle area. What do I need to change so that dragging is only possible over a certain area - handle (e.g. the rest selectable text)?
document.addEventListener('dragstart', e => {
if (e.target.classList.contains('draggable')) {
dragging = e.target;
dragging.classList.add('dragging');
cloned = dragging.cloneNode(true);
}
});
Upvotes: 0
Views: 61