A11Y: Adjust heading rules on topic lists (#13353)

Previously due to "rowheader" role we would read out topic titles twice.

This adjusts it so we apply the heading role only to the topic link.
In turn this makes navigation through topic lists more accurate (h) only
lands you on topic links. It also reduces the amount of duplicate reading
NVDA does.

Before:

Topic title link new topic link support link b481 link 19h link 2 button...

After:

Topic title link


This reduces noise, up and down once you land on a topic link can give you
more context.
This commit is contained in:
Sam 2021-06-10 10:59:30 +10:00 committed by GitHub
parent 6f76479054
commit 3fefdb1973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -40,8 +40,6 @@ export default Component.extend({
classNameBindings: [":topic-list-item", "unboundClassNames", "topic.visited"],
attributeBindings: ["data-topic-id", "role", "ariaLevel:aria-level"],
"data-topic-id": alias("topic.id"),
role: "heading",
ariaLevel: "2",
didReceiveAttrs() {
this._super(...arguments);

View File

@ -16,6 +16,8 @@ registerUnbound("topic-link", (topic, args) => {
return htmlSafe(
`<a href='${url}'
role='heading'
level='2'
class='${classes.join(" ")}'
data-topic-id='${topic.id}'>${title}</a>`
);

View File

@ -13,7 +13,7 @@
This causes the topic-post-badge to be considered the same word as "text"
at the end of the link, preventing it from line wrapping onto its own line.
--}}
<td class='main-link clearfix' colspan="1" role="rowheader">
<td class='main-link clearfix' colspan="1">
{{~raw-plugin-outlet name="topic-list-before-link"}}
<span class='link-top-line'>
{{~raw-plugin-outlet name="topic-list-before-status"}}