Skip to content

Commit

Permalink
chore: Add proper textual name, role and state to breadcrumb last item
Browse files Browse the repository at this point in the history
  • Loading branch information
taheramr committed Feb 10, 2025
1 parent 03d0574 commit dfdedd5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/breadcrumb-group/item/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,18 @@ export function BreadcrumbItem<T extends BreadcrumbGroupProps.Item>({
const anchorAttributes: React.AnchorHTMLAttributes<HTMLAnchorElement> = {
href: item.href || '#',
onClick: isLast ? preventDefault : onClickHandler,
tabIndex: 0,
};
if (isGhost) {
anchorAttributes.tabIndex = -1;
}

if (isLast) {
anchorAttributes.role = 'link';
anchorAttributes['aria-disabled'] = true;
anchorAttributes['aria-current'] = 'page';
}

const breadcrumbItem = (
<FunnelBreadcrumbItem
className={styles.text}
Expand Down

0 comments on commit dfdedd5

Please sign in to comment.