mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
fix(theme): improve a11y of DocSidebarItemCategory expand/collapsed button (#9944)
This commit is contained in:
parent
d9f0cbdb01
commit
e09245915a
1 changed files with 3 additions and 1 deletions
|
@ -101,6 +101,7 @@ function CollapseButton({
|
|||
{label: categoryLabel},
|
||||
)
|
||||
}
|
||||
aria-expanded={!collapsed}
|
||||
type="button"
|
||||
className="clean-btn menu__caret"
|
||||
onClick={onClick}
|
||||
|
@ -193,7 +194,8 @@ export default function DocSidebarItemCategory({
|
|||
}
|
||||
}
|
||||
aria-current={isCurrentPage ? 'page' : undefined}
|
||||
aria-expanded={collapsible ? !collapsed : undefined}
|
||||
role={collapsible && !href ? 'button' : undefined}
|
||||
aria-expanded={collapsible && !href ? !collapsed : undefined}
|
||||
href={collapsible ? hrefWithSSRFallback ?? '#' : hrefWithSSRFallback}
|
||||
{...props}>
|
||||
{label}
|
||||
|
|
Loading…
Add table
Reference in a new issue