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