Skip to content

Commit 03f15be

Browse files
committed
chore: add aria-haspopup handling aria-expanded and aria-controls in setActiveBtnExpanded
1 parent 76278b0 commit 03f15be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/pages/about.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,17 @@ function computePos(btn: HTMLElement) {
119119
// DON'T MOVE aria-expanded to the template, Firefox performance issues
120120
function setActiveBtnExpanded(btn: HTMLElement | null, value: boolean) {
121121
if (activeBtnDom && activeBtnDom !== btn) {
122+
activeBtnDom.removeAttribute('aria-controls')
122123
activeBtnDom.removeAttribute('aria-expanded')
123124
}
124125
activeBtnDom = btn
125126
if (btn) {
126127
if (value) {
127128
btn.setAttribute('aria-expanded', 'true')
129+
btn.setAttribute('aria-controls', 'contributor-popover')
128130
} else {
129131
btn.removeAttribute('aria-expanded')
132+
btn.removeAttribute('aria-controls')
130133
}
131134
}
132135
}
@@ -491,6 +494,7 @@ onBeforeUnmount(() => {
491494
<button
492495
v-else
493496
type="button"
497+
aria-haspopup="true"
494498
:data-cid="contributor.id"
495499
:aria-label="contributor.login"
496500
class="group relative block h-12 w-12 rounded-lg transition-transform duration-200 outline-none p-0 border-none cursor-pointer bg-transparent"
@@ -514,6 +518,7 @@ onBeforeUnmount(() => {
514518
<Transition name="pop">
515519
<div
516520
v-if="activeContributor"
521+
id="contributor-popover"
517522
ref="panelRef"
518523
data-popover-panel
519524
role="group"

0 commit comments

Comments
 (0)