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 = {
|
export type PopupPosition = {
|
||||||
top?: string;
|
top?: string;
|
||||||
@@ -14,6 +14,11 @@ export type PopupVariant = 'glass' | 'solid';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
templateUrl: './popup.html',
|
templateUrl: './popup.html',
|
||||||
styleUrl: './popup.scss',
|
styleUrl: './popup.scss',
|
||||||
|
host: {
|
||||||
|
'role': 'dialog',
|
||||||
|
'aria-modal': 'true',
|
||||||
|
'tabindex': '-1'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
export class PopupComponent {
|
export class PopupComponent {
|
||||||
/**
|
/**
|
||||||
@@ -32,6 +37,11 @@ export class PopupComponent {
|
|||||||
*/
|
*/
|
||||||
closeRequest = output<void>();
|
closeRequest = output<void>();
|
||||||
|
|
||||||
|
@HostListener('document:keydown.escape')
|
||||||
|
onKeydownHandler() {
|
||||||
|
this.onClose();
|
||||||
|
}
|
||||||
|
|
||||||
onClose() {
|
onClose() {
|
||||||
this.closeRequest.emit();
|
this.closeRequest.emit();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user