Skip to content

Commit 8545080

Browse files
authored
Ensure live region is appended to role="dialog" (#12)
Fixes: #13 It'd be nice to add tests for dialog scenarios we use ariaNotify in covering `<dialog>` and `[role="dialog"]`. It doesn't look like there are any right now - it looks a bit involved, so I will not tackle that in this PR. Filed: #14
2 parents 4f1ba86 + b2351b7 commit 8545080

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ariaNotify-polyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ if (!("ariaNotify" in Element.prototype)) {
7373

7474
// Get root element
7575
let root = /** @type {Element} */ (
76-
this.element.closest("dialog") || this.element.getRootNode()
76+
this.element.closest("dialog") || this.element.closest("[role='dialog']") || this.element.getRootNode()
7777
);
7878
if (!root || root instanceof Document) root = document.body;
7979

0 commit comments

Comments
 (0)