Skip to content

Commit

Permalink
Merge pull request matrix-org#3555 from matrix-org/t3chguy/a11y3
Browse files Browse the repository at this point in the history
Accessibility fixes to autocomplete and tabpanels
  • Loading branch information
t3chguy authored Oct 18, 2019
2 parents 7ac14e4 + d3517cd commit 4494e3b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 28 deletions.
8 changes: 5 additions & 3 deletions src/autocomplete/CommandProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ export default class CommandProvider extends AutocompleteProvider {
}

renderCompletions(completions: [React.Component]): ?React.Component {
return <div className="mx_Autocomplete_Completion_container_block">
{ completions }
</div>;
return (
<div className="mx_Autocomplete_Completion_container_block" role="listbox" aria-label={_t("Command Autocomplete")}>
{ completions }
</div>
);
}
}
2 changes: 1 addition & 1 deletion src/autocomplete/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class TextualCompletion extends React.Component {
...restProps
} = this.props;
return (
<div className={classNames('mx_Autocomplete_Completion_block', className)} {...restProps}>
<div className={classNames('mx_Autocomplete_Completion_block', className)} role="option" {...restProps}>
<span className="mx_Autocomplete_Completion_title">{ title }</span>
<span className="mx_Autocomplete_Completion_subtitle">{ subtitle }</span>
<span className="mx_Autocomplete_Completion_description">{ description }</span>
Expand Down
12 changes: 9 additions & 3 deletions src/autocomplete/DuckDuckGoProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,14 @@ export default class DuckDuckGoProvider extends AutocompleteProvider {
}

renderCompletions(completions: [React.Component]): ?React.Component {
return <div className="mx_Autocomplete_Completion_container_block">
{ completions }
</div>;
return (
<div
className="mx_Autocomplete_Completion_container_block"
role="listbox"
aria-label={_t("DuckDuckGo Results")}
>
{ completions }
</div>
);
}
}
22 changes: 11 additions & 11 deletions src/components/structures/FilePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,17 @@ const FilePanel = createReactClass({
// console.log("rendering TimelinePanel for timelineSet " + this.state.timelineSet.room.roomId + " " +
// "(" + this.state.timelineSet._timelines.join(", ") + ")" + " with key " + this.props.roomId);
return (
<TimelinePanel key={"filepanel_" + this.props.roomId}
className="mx_FilePanel"
manageReadReceipts={false}
manageReadMarkers={false}
timelineSet={this.state.timelineSet}
showUrlPreview = {false}
tileShape="file_grid"
resizeNotifier={this.props.resizeNotifier}
empty={_t('There are no visible files in this room')}
role="tabpanel"
/>
<div className="mx_FilePanel" role="tabpanel">
<TimelinePanel key={"filepanel_" + this.props.roomId}
manageReadReceipts={false}
manageReadMarkers={false}
timelineSet={this.state.timelineSet}
showUrlPreview = {false}
tileShape="file_grid"
resizeNotifier={this.props.resizeNotifier}
empty={_t('There are no visible files in this room')}
/>
</div>
);
} else {
return (
Expand Down
20 changes: 10 additions & 10 deletions src/components/structures/NotificationPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ const NotificationPanel = createReactClass({
const timelineSet = MatrixClientPeg.get().getNotifTimelineSet();
if (timelineSet) {
return (
<TimelinePanel key={"NotificationPanel_" + this.props.roomId}
className="mx_NotificationPanel"
manageReadReceipts={false}
manageReadMarkers={false}
timelineSet={timelineSet}
showUrlPreview={false}
tileShape="notif"
empty={_t('You have no visible notifications')}
role="tabpanel"
/>
<div className="mx_NotificationPanel" role="tabpanel">
<TimelinePanel key={"NotificationPanel_" + this.props.roomId}
manageReadReceipts={false}
manageReadMarkers={false}
timelineSet={timelineSet}
showUrlPreview={false}
tileShape="notif"
empty={_t('You have no visible notifications')}
/>
</div>
);
} else {
console.error("No notifTimelineSet available!");
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1745,8 +1745,10 @@
"Clear personal data": "Clear personal data",
"Warning: Your personal data (including encryption keys) is still stored on this device. Clear it if you're finished using this device, or want to sign in to another account.": "Warning: Your personal data (including encryption keys) is still stored on this device. Clear it if you're finished using this device, or want to sign in to another account.",
"Commands": "Commands",
"Command Autocomplete": "Command Autocomplete",
"Community Autocomplete": "Community Autocomplete",
"Results from DuckDuckGo": "Results from DuckDuckGo",
"DuckDuckGo Results": "DuckDuckGo Results",
"Emoji": "Emoji",
"Emoji Autocomplete": "Emoji Autocomplete",
"Notify the whole room": "Notify the whole room",
Expand Down

0 comments on commit 4494e3b

Please sign in to comment.