Skip to content

Commit e33761b

Browse files
authored
chore: accessibility — onClick aria-attrs (#292)
chore: `accessibility` — onClick aria-attrs
2 parents b6752f2 + 6f5cc49 commit e33761b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/assets/js/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@ mobileButtons.forEach((button) => {
3434

3535
const setShowing = () => {
3636
mobileButtons[0].setAttribute('aria-label', 'Close the mobile menu')
37+
mobileButtons[0].setAttribute('aria-expanded', 'true')
38+
mobileMenuSection.setAttribute('aria-hidden', 'false')
3739
mobileMenuSection.classList.remove('not-showing')
3840
setTimeout(() => documentBody.classList.add('no-scroll'), 300)
3941
}
4042

4143
const setHidden = () => {
4244
mobileButtons[0].setAttribute('aria-label', 'Open the mobile menu')
45+
mobileButtons[0].setAttribute('aria-expanded', 'false')
46+
mobileMenuSection.setAttribute('aria-hidden', 'true')
4347
mobileMenuSection.classList.add('not-showing')
4448
documentBody.classList.remove('no-scroll')
4549
}

0 commit comments

Comments
 (0)