Desktop: Accessibility: Improve "toggle all notebooks" accessibility (#11918)

pull/11929/head
Henry Heino 2025-03-04 03:57:11 -08:00 committed by GitHub
parent 4ad1b49769
commit b831d8c068
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -22,13 +22,14 @@ interface CollapseExpandAllButtonProps {
} }
const CollapseExpandAllButton = (props: CollapseExpandAllButtonProps) => { const CollapseExpandAllButton = (props: CollapseExpandAllButtonProps) => {
// To allow it to be accessed by accessibility tools, the new folder button // To allow it to be accessed by accessibility tools, the toggle button
// is not included in the portion of the list with role='tree'. // is not included in the portion of the list with role='tree'.
const icon = props.allFoldersCollapsed ? 'far fa-caret-square-right' : 'far fa-caret-square-down'; const icon = props.allFoldersCollapsed ? 'far fa-caret-square-right' : 'far fa-caret-square-down';
const label = props.allFoldersCollapsed ? _('Expand all notebooks') : _('Collapse all notebooks');
return <button onClick={() => onToggleAllFolders(props.allFoldersCollapsed)} className='sidebar-header-button -collapseall'> return <button onClick={() => onToggleAllFolders(props.allFoldersCollapsed)} className='sidebar-header-button -collapseall'>
<i <i
aria-label={_('Collapse / Expand all notebooks')} aria-label={label}
role='img' role='img'
className={icon} className={icon}
/> />