-
Notifications
You must be signed in to change notification settings - Fork 3
Resource card headings for screen reader navigation #2658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
frontends/main/src/page-components/ResourceCarousel/ResourceCarousel.tsx
Outdated
Show resolved
Hide resolved
| test("Headings", async () => { | ||
| setupAPIs() | ||
|
|
||
| setMockResponse.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: It would be straightforward to give assertHeadings a maxLevel opt. That might be a more transparent approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, I guess that doesn't help here actually, since below we do test for h3
frontends/main/src/page-components/ResourceCarousel/ResourceCarousel.tsx
Outdated
Show resolved
Hide resolved
ChristopherChudzicki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 This is working well. I left a few suggestions.
I do think the LinkableTitle change is worth making and the SearchDisplay change.
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/8557
Description (What does it do?)
Adds the ARIA heading role to resource card titles to they are treated as heading elements and navigable by screen reader users.
The titles are links, so we don't want to replace them with heading elements as they then would not be discoverable as links.
Instead, we're adding an additional span element with the heading role and aria-level.
Cards within carousels use the next heading level down from the carousel section title.
Elsewhere we set to the lowest level, H6. We know there are no subheadings, but it's challenging to reliably determine the next level up on the page in all instances to avoid level gaps.
How can this be tested?
VoiceOver on Mac:
NVDA on Windows:
JAWS on Windows: