Skip to content

Commit e034788

Browse files
committed
Handle case where sideMenu is already expanded on page load
1 parent 611c622 commit e034788

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/dokka-presets/scripts/accessibility.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ function ensureNavButtonInteractable() {
8383
// Make the navButton focusable, add accessibility information
8484
navButton.setAttribute('tabindex', '0');
8585
navButton.setAttribute('role', 'button');
86-
navButton.setAttribute('aria-expanded', 'false');
86+
87+
const sideMenuPartParent = navButton.closest(".sideMenuPart")
88+
navButton.setAttribute('aria-expanded', sideMenuPartParent.classList.contains('hidden') ? 'false' : 'true');
8789

8890
// Grab the page ID, use it for aria-label and aria-controls
8991
const sectionName = navButton.parentElement.parentElement.getAttribute('pageid')

0 commit comments

Comments
 (0)