Skip to content

Commit 5190c69

Browse files
committed
OwnersList: Use sr-only for user/team names
This ensures that screen readers are able to read the names. The commit also uses `aria-hidden` on the avatar itself to prevent the names from being read twice.
1 parent 35d7c23 commit 5190c69

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/components/owners-list.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
local-class="link"
1212
data-test-owner-link={{owner.login}}
1313
>
14-
<UserAvatar @user={{owner}} @size="medium-small" local-class="avatar" />
15-
<span local-class="name">{{or owner.display_name owner.name}}</span>
14+
<UserAvatar @user={{owner}} @size="medium-small" local-class="avatar" aria-hidden="true" />
15+
<span local-class="name {{unless this.showDetailedList "hidden-name"}}">{{or owner.display_name owner.name}}</span>
1616
</LinkTo>
1717
</li>
1818
{{/each}}

app/components/owners-list.module.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
> * {
3535
margin: 0 10px 10px 0;
3636
}
37-
38-
.name {
39-
display: none;
40-
}
4137
}
4238

4339
.avatar {
@@ -50,3 +46,7 @@
5046
border-radius: 4px;
5147
}
5248
}
49+
50+
.hidden-name {
51+
composes: sr-only from '../styles/shared/a11y.module.css';
52+
}

0 commit comments

Comments
 (0)