mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
fix(a11y): resolve sidebar, find, toolbar missing aria-expanded and
aria-controls state In testing, screen readers such as JAWS have trouble understanding the expanded state of the buttons that expand hidden menus due to lacking aria-expanded attribute. Also, given that the buttons do not contain the controlled/shown element, they should also define the aria-controls attribute with associated element id per https://www.w3.org/TR/wai-aria-1.1/#aria-expanded This fixes adds these requirements for the sidebar, find, and secondary toolbar buttons.
This commit is contained in:
parent
c92011e093
commit
374da648dd
4 changed files with 9 additions and 3 deletions
|
@ -264,6 +264,7 @@ class PDFSidebar {
|
|||
}
|
||||
this.isOpen = true;
|
||||
this.toggleButton.classList.add("toggled");
|
||||
this.toggleButton.setAttribute("aria-expanded", "true");
|
||||
|
||||
this.outerContainer.classList.add("sidebarMoving", "sidebarOpen");
|
||||
|
||||
|
@ -282,6 +283,7 @@ class PDFSidebar {
|
|||
}
|
||||
this.isOpen = false;
|
||||
this.toggleButton.classList.remove("toggled");
|
||||
this.toggleButton.setAttribute("aria-expanded", "false");
|
||||
|
||||
this.outerContainer.classList.add("sidebarMoving");
|
||||
this.outerContainer.classList.remove("sidebarOpen");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue