From 35dd22be898f23d1bde72f409d1890b0c8e986d3 Mon Sep 17 00:00:00 2001 From: Hans Allis Date: Wed, 16 Jun 2021 15:56:35 +0200 Subject: [PATCH] Update web-dialog.ts Moved setting the aria-modal attribute from the constructor to the connectedCallback method --- src/lib/web-dialog.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +}