Skip to content

Commit

Permalink
Handle case where sideMenu is already expanded on page load
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis committed Aug 2, 2024
1 parent 611c622 commit e034788
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/dokka-presets/scripts/accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ function ensureNavButtonInteractable() {
// Make the navButton focusable, add accessibility information
navButton.setAttribute('tabindex', '0');
navButton.setAttribute('role', 'button');
navButton.setAttribute('aria-expanded', 'false');

const sideMenuPartParent = navButton.closest(".sideMenuPart")
navButton.setAttribute('aria-expanded', sideMenuPartParent.classList.contains('hidden') ? 'false' : 'true');

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

0 comments on commit e034788

Please sign in to comment.