-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Correct Aria / Markup for a current page in Breadcrumb Item #67
Conversation
Good idea @roybarber.
It might be good to enforce the styling here with aria-current for the active breadcrumb. See the screenshot below. The last item will now be a link so the same styling won't be there. ![]() |
Good point. I'll do a quick non link style for it. Just an empty href makes the page link to itself. If we placed a "/" then it would link back to the home page. |
@roybarber you are correct. Not sure why but I was thinking of home link. Ignore me! 🤣 |
Updated the PR to take match the current style, with a matching hover state |
@roybarber thanks for taking the time to make this pull request! There are actually multiple valid ways in which we can markup a breadcrumb component. We can have the last item be a |
@markteekman No problem, like anything A11y theres many ways to skin a cat, ive updated the PR to take into consideration your comments :) |
Fair and valid points @markteekman & @roybarber ... Yeah, there is a few ways of looking at it like you said. Was just pointing out that the styling would be different that is all. Just looking at how the GOV UK team do it for their breadcrumbs. They leave the link exposed and don't leave the current item as text, which is interesting. Although they do explicitly say to use the breadcrumbs component only when you need to help users understand and move between the multiple levels of a website. it seems that omitting is also done on some pages also it so that is also another option. A span element with aria-current="page" is perfectly valid, and similar to what the USWDS Breadcrumb component implemented. |
@garyb1 @roybarber yeah, there are certainly more ways to solve this, even to take in consideration when to use this component. That's what can make accessibility in general complex sometimes, or lead to wrong implementations. Although I think we've got a nice upgrade right here! Maybe in the future it may be worthwhile to make the current item optional. For now though, thanks for your thoughts 🙂 |
Adding in the missing aria-current attribute for a current page. The current page should also be a blank link (linking to itself)
Example:
https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/examples/breadcrumb/