Reputation: 444
I'm trying to find out, if it's possible using CDK's Drag&Drop to not change position of any element form the list(during dragging) until it's dropped. Right now elements change their position when any element is dragged.
Upvotes: 3
Views: 1339
Reputation: 2632
You can use the cdkDropListSortingDisabled
directive.
<div
cdkDropList
[cdkDropListData]="items"
class="example-list"
cdkDropListSortingDisabled
(cdkDropListDropped)="drop($event)">
<div class="example-box" *ngFor="let item of items" cdkDrag>{{item}}</div>
</div>
For further examples see cdk drag and drop examples
Upvotes: 1