Add aria-current=page to last breadcrumb item (a11y semantic for current location)
This commit is contained in:
@@ -45,7 +45,12 @@ export const Breadcrumbs: FC<BreadcrumbsProps> = ({ items = [] }) => {
|
||||
{showAsLink ? (
|
||||
<a href={item.url} className="breadcrumbs__link">{item.label}</a>
|
||||
) : (
|
||||
<span className="breadcrumbs__text">{item.label}</span>
|
||||
<span
|
||||
className="breadcrumbs__text"
|
||||
{...(isLast ? { "aria-current": "page" } : {})}
|
||||
>
|
||||
{item.label}
|
||||
</span>
|
||||
)}
|
||||
{!isLast && (
|
||||
<span className="breadcrumbs__separator" aria-hidden="true">/</span>
|
||||
|
||||
Reference in New Issue
Block a user