diff --git a/src/lib/web-dialog.ts b/src/lib/web-dialog.ts index 2eb73d9..890b916 100644 --- a/src/lib/web-dialog.ts +++ b/src/lib/web-dialog.ts @@ -88,7 +88,6 @@ export class WebDialog extends HTMLElement { this.onKeyDown = this.onKeyDown.bind(this); // Set aria attributes - this.setAttribute("aria-modal", "true"); this.$dialog.setAttribute("role", "alertdialog"); } @@ -96,6 +95,7 @@ export class WebDialog extends HTMLElement { * Attaches event listeners when connected. */ connectedCallback () { + this.setAttribute("aria-modal", "true"); this.$backdrop.addEventListener("click", this.onBackdropClick); } @@ -245,4 +245,4 @@ declare global { interface HTMLElementTagNameMap { "web-dialog": WebDialog; } -} \ No newline at end of file +}