I was trying to combine mat-dialog
and drag-drop
in Angular Material 9.
The dialog.html
is:
<h1 mat-dialog-title cdkDrag cdkDragHandle cdkDragRootElement=".cdk-overlay-pane">
Title</h1>
<div>
<p>What's your favorite animal?</p>
</div>
<div mat-dialog-actions>
<button mat-stroked-button (click)="onExit()">Exit</button>
</div>
But it seems that the whole dialog becomes the drag handle instead of just the dialog-title
part.
stackblitz:https://stackblitz.com/edit/angular-ivy-putdym
Could someone please give a hint?
transform
is set to the element withdrag
attribute. Will try to find a way to bind that to the.cdk-overlay-pane
. – Parturifacient