How to disable cdkDrag dragging animation?

Viewed 1849
1 Answers

You can customize the dragging preview with cdkDragPreview directive, described in Angular Materials D&D CdkDragPreview docs.

<div cdkDropList class="example-list" (cdkDropListDropped)="drop($event)">
  <div class="example-box" *ngFor="let movie of movies" cdkDrag>
    {{movie.title}}
    <img *cdkDragPreview [src]="movie.poster" [alt]="movie.title">
  </div>
</div>

See example Stackblitz.


For your example you can add an element into your cdkDrag root element.

E.g.:

...
<tr *ngFor="let feed of todo;let index = index" cdkDrag  (cdkDragStarted)="started($event)">
          <span *cdkDragPreview>Test</span>
                    <td>
...

Check your adapted Stackblitz.

Related