From bac135853d8feccf23376b3461448ac05ca534bc Mon Sep 17 00:00:00 2001 From: copecone Date: Wed, 1 Apr 2026 13:12:33 +0900 Subject: [PATCH] Improve Popup Accessibility --- src/app/components/popup/popup.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/components/popup/popup.ts b/src/app/components/popup/popup.ts index b548024..ace0ac2 100644 --- a/src/app/components/popup/popup.ts +++ b/src/app/components/popup/popup.ts @@ -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(); + @HostListener('document:keydown.escape') + onKeydownHandler() { + this.onClose(); + } + onClose() { this.closeRequest.emit(); }