Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 8ef61ce

Browse files
authored
Merge pull request #3514 from matrix-org/t3chguy/accessibility3
Various ARIA a11y fixes.
2 parents 8e96bad + f1db0cf commit 8ef61ce

File tree

16 files changed

+59
-54
lines changed

16 files changed

+59
-54
lines changed

src/components/structures/FilePanel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,12 @@ const FilePanel = createReactClass({
126126
tileShape="file_grid"
127127
resizeNotifier={this.props.resizeNotifier}
128128
empty={_t('There are no visible files in this room')}
129+
role="tabpanel"
129130
/>
130131
);
131132
} else {
132133
return (
133-
<div className="mx_FilePanel">
134+
<div className="mx_FilePanel" role="tabpanel">
134135
<Loader />
135136
</div>
136137
);

src/components/structures/NotificationPanel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ const NotificationPanel = createReactClass({
4646
showUrlPreview={false}
4747
tileShape="notif"
4848
empty={_t('You have no visible notifications')}
49+
role="tabpanel"
4950
/>
5051
);
5152
} else {
5253
console.error("No notifTimelineSet available!");
5354
return (
54-
<div className="mx_NotificationPanel">
55+
<div className="mx_NotificationPanel" role="tabpanel">
5556
<Loader />
5657
</div>
5758
);

src/components/structures/RoomSubList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ const RoomSubList = createReactClass({
258258
const tabindex = this.props.isFiltered ? "0" : "-1";
259259
return (
260260
<div className="mx_RoomSubList_labelContainer" title={ title } ref="header">
261-
<AccessibleButton onClick={ this.onClick } className="mx_RoomSubList_label" tabIndex={tabindex}>
261+
<AccessibleButton onClick={this.onClick} className="mx_RoomSubList_label" tabIndex={tabindex} aria-expanded={!isCollapsed}>
262262
{ chevron }
263263
<span>{this.props.label}</span>
264264
{ incomingCall }

src/components/views/elements/AccessibleTooltipButton.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
/*
2-
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
2+
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
3+
Copyright 2019 The Matrix.org Foundation C.I.C.
34
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
78
8-
http://www.apache.org/licenses/LICENSE-2.0
9+
http://www.apache.org/licenses/LICENSE-2.0
910
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
1617

1718
import React from 'react';
1819
import PropTypes from 'prop-types';
@@ -55,7 +56,7 @@ export default class AccessibleTooltipButton extends React.PureComponent {
5556
label={title}
5657
/> : <div />;
5758
return (
58-
<AccessibleButton {...props} onMouseOver={this.onMouseOver} onMouseOut={this.onMouseOut}>
59+
<AccessibleButton {...props} onMouseOver={this.onMouseOver} onMouseOut={this.onMouseOut} aria-label={title}>
5960
{ tip }
6061
</AccessibleButton>
6162
);

src/components/views/groups/GroupMemberInfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ module.exports = createReactClass({
183183

184184
const GeminiScrollbarWrapper = sdk.getComponent('elements.GeminiScrollbarWrapper');
185185
return (
186-
<div className="mx_MemberInfo">
186+
<div className="mx_MemberInfo" role="tabpanel">
187187
<GeminiScrollbarWrapper autoshow={true}>
188188
<AccessibleButton className="mx_MemberInfo_cancel" onClick={this._onCancel}>
189189
<img src={require("../../../../res/img/cancel.svg")} width="18" height="18" className="mx_filterFlipColor" />

src/components/views/groups/GroupMemberList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export default createReactClass({
222222
}
223223

224224
return (
225-
<div className="mx_MemberList">
225+
<div className="mx_MemberList" role="tabpanel">
226226
{ inviteButton }
227227
<GeminiScrollbarWrapper autoshow={true}>
228228
{ joined }

src/components/views/groups/GroupRoomInfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ module.exports = createReactClass({
214214

215215
const groupRoomName = this.state.groupRoom.displayname;
216216
return (
217-
<div className="mx_MemberInfo">
217+
<div className="mx_MemberInfo" role="tabpanel">
218218
<GeminiScrollbarWrapper autoshow={true}>
219219
<AccessibleButton className="mx_MemberInfo_cancel" onClick={this._onCancel}>
220220
<img src={require("../../../../res/img/cancel.svg")} width="18" height="18" className="mx_filterFlipColor" />

src/components/views/groups/GroupRoomList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export default createReactClass({
153153
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
154154
const TruncatedList = sdk.getComponent("elements.TruncatedList");
155155
return (
156-
<div className="mx_GroupRoomList">
156+
<div className="mx_GroupRoomList" role="tabpanel">
157157
{ inviteButton }
158158
<GeminiScrollbarWrapper autoshow={true} className="mx_GroupRoomList_joined mx_GroupRoomList_outerWrapper">
159159
<TruncatedList className="mx_GroupRoomList_wrapper" truncateAt={this.state.truncateAt}

src/components/views/right_panel/HeaderButton.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright 2015, 2016 OpenMarket Ltd
33
Copyright 2017 Vector Creations Ltd
44
Copyright 2017 New Vector Ltd
55
Copyright 2018 New Vector Ltd
6+
Copyright 2019 The Matrix.org Foundation C.I.C.
67
78
Licensed under the Apache License, Version 2.0 (the "License");
89
you may not use this file except in compliance with the License.
@@ -42,8 +43,8 @@ export default class HeaderButton extends React.Component {
4243
});
4344

4445
return <AccessibleButton
45-
aria-label={this.props.title}
46-
aria-expanded={this.props.isHighlighted}
46+
aria-selected={this.props.isHighlighted}
47+
role="tab"
4748
title={this.props.title}
4849
className={classes}
4950
onClick={this.onClick}>

src/components/views/right_panel/HeaderButtons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default class HeaderButtons extends React.Component {
9191

9292
render() {
9393
// inline style as this will be swapped around in future commits
94-
return <div className="mx_HeaderButtons">
94+
return <div className="mx_HeaderButtons" role="tablist">
9595
{ this.renderButtons() }
9696
</div>;
9797
}

0 commit comments

Comments
 (0)