I have been utilizing the 'Drag & Drop List' feature from .
Currently, any click and drag action on an <li>
element will cause it to move by default.
Is there a method to limit this behavior so that the user must click on a specific sub-element of the <li>
instead?
I have created a plunkr example (http://plnkr.co/edit/6mOkqRuY4aXY3NUE5W7F?p=preview) where each <li>
contains two divs as follows:
<ul dnd-list="models.lists.A">
<li ng-repeat="item in models.lists.A"
dnd-draggable="item"
dnd-moved="models.lists.A.splice($index, 1)"
dnd-effect-allowed="move"
dnd-selected="models.selected = item"
ng-class="{'selected': models.selected === item}">
<div class="theheader">A header</div>
<div class="thebody">{{item.label}}</div>
</li>
</ul>
I am interested in restricting the click and drag functionality to only work on the theheader div. If I click within the thebody div, I would like nothing to happen.
(The reason for this is because in my actual project, there are edit boxes within the <li>
. When clicking on an edit box and dragging to select its contents, the entire <li>
ends up moving, which is not ideal for user experience.)