How can I prevent dragging when I'm inside my input
and I'm dragging around.
I only want the pink-meat
to act as a drag-handle
.
<div cdkDropList class="example-list" (cdkDropListDropped)="drop($event)">
<div class="example-box" *ngFor="let movie of movies" cdkDrag>
<input [placeholder]="movie" (click)="stopIt($event)" (mousemove)="stopIt($event)">
</div>
</div>
drop(event: CdkDragDrop<string[]>) {
moveItemInArray(this.movies, event.previousIndex, event.currentIndex);
}
stopIt(e) {
e.stopPropagation();
}
So far its not working :/.
I would prevent mousedown
instead of click
event:
(mousedown)="stopIt($event)"
Also for mobile devices maybe you will be looking for preventing touchstart
event