mirror of
https://github.com/zotero/zotero.git
synced 2026-09-28 01:31:40 +00:00
a11y: clear aria-expanded on empty itemTree rows (#5201)
Per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-expanded#treeitems only treeitems that contain children should have the aria-expanded attribute. This is instead of having aria-expanded="false" on empty regular items or standalone attachments, which erroneously indicates to screen readers that the row has children but is collapsed. Fixes: #5200
This commit is contained in:
parent
0bff70b186
commit
f568363098
1 changed files with 4 additions and 1 deletions
|
|
@ -3167,7 +3167,10 @@ var ItemTree = class ItemTree extends LibraryTree {
|
|||
// Accessibility
|
||||
div.setAttribute('role', 'treeitem');
|
||||
div.setAttribute('aria-level', this.getLevel(index) + 1);
|
||||
if (!this.isContainerEmpty(index)) {
|
||||
if (this.isContainerEmpty(index)) {
|
||||
div.removeAttribute('aria-expanded');
|
||||
}
|
||||
else {
|
||||
div.setAttribute('aria-expanded', this.isContainerOpen(index));
|
||||
}
|
||||
if (rowData.contextRow) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue