explicitly call close dialog on escape or backdrop

This commit is contained in:
Dan Percic 2023-07-18 15:20:29 +03:00
parent ae52093b5d
commit 699e74a867

View File

@ -28,7 +28,7 @@ export abstract class IqserDialogComponent<ComponentType, DataType, ReturnType>
.backdropClick()
.pipe(takeUntilDestroyed())
// eslint-disable-next-line rxjs/no-ignored-subscription
.subscribe(() => this.close());
.subscribe(() => this.dialogRef.close());
}
get valid(): boolean {
@ -46,7 +46,7 @@ export abstract class IqserDialogComponent<ComponentType, DataType, ReturnType>
@HostListener('window:keydown.Escape', ['$event'])
onEscape(): void {
if (this.dialog.openDialogs.length === 1) {
this.close();
this.dialogRef.close();
}
}