Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a023e4d commit 567226bCopy full SHA for 567226b
index.js
@@ -26,13 +26,16 @@ class DetailsMenuElement extends HTMLElement {
26
}
27
28
connectedCallback() {
29
- this.setAttribute('role', 'menu')
+ if (!this.hasAttribute('role')) this.setAttribute('role', 'menu')
30
31
const details = this.parentElement
32
if (!details) return
33
34
const summary = details.querySelector('summary')
35
- if (summary) summary.setAttribute('aria-haspopup', 'menu')
+ if (summary) {
36
+ summary.setAttribute('aria-haspopup', 'menu')
37
+ if (!summary.hasAttribute('role')) summary.setAttribute('role', 'button')
38
+ }
39
40
details.addEventListener('click', shouldCommit)
41
details.addEventListener('change', shouldCommit)
0 commit comments