Skip to content

Commit

Permalink
fix (a11y): breadcrumb focus outline now works without side effects
Browse files Browse the repository at this point in the history
  • Loading branch information
noa.santo committed Sep 19, 2024
1 parent 5ac8d36 commit 08c54d2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/layout/breadcrumb/breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const BreadcrumbContainer = styled.ol`
list-style: none;
display: flex;
flex-wrap: nowrap;
padding: 0;
overflow-x: clip;
padding-left: 4px;
transform: translateX(-4px);
`;

const BreadcrumbListItem = styled.li`
Expand All @@ -31,6 +33,10 @@ const BreadcrumbListItem = styled.li`
}
`;

const BreadcrumbLink = styled(Link)`
display: inline-block;
`;

interface BreadcrumbProps {
breadcrumbEntries: BreadcrumbEntry[];
}
Expand All @@ -49,7 +55,9 @@ export const Breadcrumb = ({
{breadcrumbEntries.map((breadcrumbEntry) => {
return (
<BreadcrumbListItem key={breadcrumbEntry.label}>
<Link to={breadcrumbEntry.pathname}>{breadcrumbEntry.label}</Link>
<BreadcrumbLink to={breadcrumbEntry.pathname}>
{breadcrumbEntry.label}
</BreadcrumbLink>
</BreadcrumbListItem>
);
})}
Expand Down

0 comments on commit 08c54d2

Please sign in to comment.