Skip to content

Commit

Permalink
fix(a11y): DocSidebarItemCategory expand/collapsed button
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Mar 12, 2024
1 parent 319d73d commit aae6a82
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,8 +194,9 @@ export default function DocSidebarItemCategory({
}
}
aria-current={isCurrentPage ? 'page' : undefined}
aria-expanded={collapsible ? !collapsed : undefined}
href={collapsible ? hrefWithSSRFallback ?? '#' : hrefWithSSRFallback}
aria-expanded={collapsible && !href ? !collapsed : undefined}
role={collapsible && !href ? 'button' : undefined}
{...props}>
{label}
</Link>
Expand Down

0 comments on commit aae6a82

Please sign in to comment.