diff --git a/src/lib/dialog/iqser-dialog-component.directive.ts b/src/lib/dialog/iqser-dialog-component.directive.ts index 98c866f..64fb377 100644 --- a/src/lib/dialog/iqser-dialog-component.directive.ts +++ b/src/lib/dialog/iqser-dialog-component.directive.ts @@ -1,7 +1,7 @@ import { Directive, HostListener, inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { hasFormChanged, IqserEventTarget } from '../utils'; +import { hasFormChanged } from '../utils'; import { FormGroup } from '@angular/forms'; const DATA_TYPE_SYMBOL = Symbol.for('DATA_TYPE'); @@ -10,7 +10,6 @@ const RETURN_TYPE_SYMBOL = Symbol.for('RETURN_TYPE'); export type DATA_TYPE = typeof DATA_TYPE_SYMBOL; export type RETURN_TYPE = typeof RETURN_TYPE_SYMBOL; -const TARGET_NODE = 'mat-dialog-container'; @Directive() export abstract class IqserDialogComponent { @@ -53,8 +52,7 @@ export abstract class IqserDialogComponent @HostListener('window:keydown.Enter', ['$event']) onEnter(event: KeyboardEvent): void { event?.stopImmediatePropagation(); - const node = (event.target as IqserEventTarget).localName?.trim()?.toLowerCase(); - if (this.onEnterValidator(event) && node === TARGET_NODE) { + if (this.onEnterValidator(event)) { this.close(); } }