I am using PrimeNg library. It has nice <p-dialog> component, which creates dialogs draggable by default. But in certain context, I am using PrimeNg's API dialogService, to create the dialog dynamically. Notice the this.dialogService.open().
But in this case, the dialog is not draggable.
Is there any workaround to make it work?
Sample code
class MyClass {
constructor(private readonly dialogService: DialogService) {}
openDialog(options: KonsolidacniKonfliktDialogOptions): DynamicDialogRef {
const dialogRef = this.dialogService.open(SomeComponentToRenderInsideDialog, {
header: options.dialogHeader,
width: this.dialogWidth,
height: this.dialogHeight,
styleClass: this.dialogStyleClass,
data: {
whatever: options.whatever,
},
});
return dialogRef;
}
}
In this example the dialog box is draggable :
https://stackblitz.com/edit/angular-primeng-dialog-yodw4v