Skip to content
This repository was archived by the owner on Sep 22, 2022. It is now read-only.

Commit 429f540

Browse files
authored
Merge pull request #35 from github/aria
Remove aria-haspopup=dialog and add role=button
2 parents 91a1435 + 389956e commit 429f540

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class DetailsDialogElement extends HTMLElement {
196196

197197
const summary = details.querySelector('summary')
198198
if (summary) {
199-
summary.setAttribute('aria-haspopup', 'dialog')
199+
summary.setAttribute('role', 'button')
200200
summary.addEventListener('click', onSummaryClick, {capture: true})
201201
}
202202

test/test.js

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ describe('details-dialog-element', function() {
4545
document.body.innerHTML = ''
4646
})
4747

48+
it('initializes', function() {
49+
assert.equal(summary.getAttribute('role'), 'button')
50+
assert.equal(dialog.getAttribute('role'), 'dialog')
51+
assert.equal(dialog.getAttribute('aria-modal'), 'true')
52+
})
53+
4854
it('toggles open', function() {
4955
assert(!details.open)
5056
dialog.toggle(true)

0 commit comments

Comments
 (0)