Skip to content

Commit ca07c8f

Browse files
committed
Merge pull request element-hq#365 from vector-im/avatar_initial_a11y
Mark up the avatar initials so they're not read out by screen readers
2 parents ff59fc8 + 2fd7196 commit ca07c8f

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/skins/vector/css/atoms/MemberAvatar.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ limitations under the License.
2323
position: absolute;
2424
color: #fff;
2525
text-align: center;
26+
speak: none;
2627
}
2728

2829
.mx_MemberAvatar_image {
2930
border-radius: 20px;
30-
}
31+
}

src/skins/vector/css/atoms/RoomAvatar.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ limitations under the License.
2222
color: #fff;
2323
text-align: center;
2424
font-weight: normal ! important;
25+
speak: none;
2526
}

src/skins/vector/views/atoms/MemberAvatar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = React.createClass({
5050

5151
return (
5252
<span className="mx_MemberAvatar">
53-
<span className="mx_MemberAvatar_initial"
53+
<span className="mx_MemberAvatar_initial" aria-hidden="true"
5454
style={{ fontSize: (this.props.width * 0.75) + "px",
5555
width: this.props.width + "px",
5656
lineHeight: this.props.height*1.2 + "px" }}>{ initial }</span>

src/skins/vector/views/atoms/RoomAvatar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module.exports = React.createClass({
5757

5858
return (
5959
<span>
60-
<span className="mx_RoomAvatar_initial"
60+
<span className="mx_RoomAvatar_initial" aria-hidden="true"
6161
style={{ fontSize: (this.props.width * 0.75) + "px",
6262
width: this.props.width + "px",
6363
lineHeight: this.props.height*1.2 + "px" }}>{ initial }</span>

0 commit comments

Comments
 (0)