Skip to content

Commit eb72ed1

Browse files
committed
chore: handle aria-expanded correctly
1 parent aa0b3e2 commit eb72ed1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/pages/about.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ function computePos(btn: HTMLElement) {
120120
function setActiveBtnExpanded(btn: HTMLElement | null, value: boolean) {
121121
if (activeBtnDom && activeBtnDom !== btn) {
122122
activeBtnDom.removeAttribute('aria-controls')
123-
activeBtnDom.removeAttribute('aria-expanded')
123+
activeBtnDom.setAttribute('aria-expanded', 'false')
124124
}
125125
activeBtnDom = btn
126126
if (btn) {
127127
if (value) {
128128
btn.setAttribute('aria-expanded', 'true')
129129
btn.setAttribute('aria-controls', 'contributor-popover')
130130
} else {
131-
btn.removeAttribute('aria-expanded')
131+
btn.setAttribute('aria-expanded', 'false')
132132
btn.removeAttribute('aria-controls')
133133
}
134134
}
@@ -494,6 +494,7 @@ onBeforeUnmount(() => {
494494
<button
495495
v-else
496496
type="button"
497+
aria-expanded="false"
497498
:data-cid="contributor.id"
498499
:aria-label="contributor.login"
499500
class="group relative block h-12 w-12 rounded-lg transition-transform duration-200 outline-none p-0 border-none cursor-pointer bg-transparent"

0 commit comments

Comments
 (0)