Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/core/event/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,11 @@ export function Events(Base) {

// Set aria-expanded attribute
ariaElms.forEach(toggleElm => {
const expanded = force ?? sidebarElm.classList.contains('show');
toggleElm.setAttribute('aria-expanded', expanded);
toggleElm.setAttribute(
'aria-expanded',
force ?? sidebarElm.classList.contains('show'),
'aria-label',
expanded ? 'Hide primary navigation' : 'Show primary navigation',
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/core/render/tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function main(config) {
? ''
: `
<button class="sidebar-toggle" tabindex="-1" title="Press \\ to toggle">
<div class="sidebar-toggle-button" tabindex="0" aria-label="Toggle primary navigation" aria-keyshortcuts="\\" aria-controls="__sidebar">
<div class="sidebar-toggle-button" tabindex="0" aria-label="Hide primary navigation" aria-keyshortcuts="Use shortcut key \\" aria-controls="__sidebar" role="button">
<span></span><span></span><span></span>
</div>
</button>
Expand Down
Loading