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 358aaae
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 358aaae

Please # to comment.