Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
2d6e0995c7
1 file changed
+11
-1
@@ -1,4 +1,4 @@
|
||||
import { Component, input, output } from '@angular/core';
|
||||
import { Component, input, output, HostListener } from '@angular/core';
|
||||
|
||||
export type PopupPosition = {
|
||||
top?: string;
|
||||
@@ -14,6 +14,11 @@ export type PopupVariant = 'glass' | 'solid';
|
||||
standalone: true,
|
||||
templateUrl: './popup.html',
|
||||
styleUrl: './popup.scss',
|
||||
host: {
|
||||
'role': 'dialog',
|
||||
'aria-modal': 'true',
|
||||
'tabindex': '-1'
|
||||
}
|
||||
})
|
||||
export class PopupComponent {
|
||||
/**
|
||||
@@ -32,6 +37,11 @@ export class PopupComponent {
|
||||
*/
|
||||
closeRequest = output<void>();
|
||||
|
||||
@HostListener('document:keydown.escape')
|
||||
onKeydownHandler() {
|
||||
this.onClose();
|
||||
}
|
||||
|
||||
onClose() {
|
||||
this.closeRequest.emit();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user