Skip to content

Commit

Permalink
fix(theme): improve a11y of DocSidebarItemCategory expand/collapsed b…
Browse files Browse the repository at this point in the history
…utton (#9944)
  • Loading branch information
mxschmitt authored and OzakIOne committed Mar 15, 2024
1 parent d9f0cbd commit e092459
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function CollapseButton({
{label: categoryLabel},
)
}
aria-expanded={!collapsed}
type="button"
className="clean-btn menu__caret"
onClick={onClick}
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit e092459

Please sign in to comment.