Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
[MM-22161] - Improve accessibility of channel switcher (#6199)
Browse files Browse the repository at this point in the history
* [MM-22161] - Improve accessibility of channel switcher

* Fix voice over for channels list

* update snaps

* bring back handleClick

* PR comments

Co-authored-by: Nevyana Angelova <[email protected]>
Co-authored-by: Nevyana Angelova <[email protected]>
  • Loading branch information
3 people committed Oct 6, 2020
1 parent 425cc09 commit d5ed931
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
exports[`components/QuickSwitchModal should match snapshot 1`] = `
<Modal
animation={false}
aria-describedby="quickSwitchHint"
aria-labelledby="quickSwitchModalLabel"
autoFocus={true}
backdrop={true}
Expand Down Expand Up @@ -53,7 +54,7 @@ exports[`components/QuickSwitchModal should match snapshot 1`] = `
id="quickSwitchHint"
>
<injectIntl(FormattedMarkdownMessage)
defaultMessage="Type to find a channel. Use **▲/▼** to browse, **ENTER** to select, **ESC** to dismiss."
defaultMessage="Type to find a channel. Use **UP/DOWN** to browse, **ENTER** to select, **ESC** to dismiss."
id="quick_switch_modal.help_no_team"
/>
</div>
Expand Down
3 changes: 2 additions & 1 deletion components/quick_switch_modal/quick_switch_modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export default class QuickSwitchModal extends React.PureComponent {
help = (
<FormattedMarkdownMessage
id='quick_switch_modal.help_no_team'
defaultMessage='Type to find a channel. Use **▲/▼** to browse, **ENTER** to select, **ESC** to dismiss.'
defaultMessage='Type to find a channel. Use **UP/DOWN** to browse, **ENTER** to select, **ESC** to dismiss.'
/>
);
}
Expand All @@ -285,6 +285,7 @@ export default class QuickSwitchModal extends React.PureComponent {
restoreFocus={false}
role='dialog'
aria-labelledby='quickSwitchModalLabel'
aria-describedby='quickSwitchHint'
animation={false}
>
<Modal.Header
Expand Down
1 change: 1 addition & 0 deletions components/suggestion/suggestion_list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export default class SuggestionList extends React.PureComponent {
return (<div className={mainClass}>
<div
id='suggestionList'
role='list'
ref={this.contentRef}
style={{...contentStyle}}
className={contentClass}
Expand Down
2 changes: 2 additions & 0 deletions components/suggestion/switch_channel_provider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ class SwitchChannelSuggestion extends Suggestion {
onClick={this.handleClick}
onMouseMove={this.handleMouseMove}
className={className}
role='listitem'
ref={(node) => {
this.node = node;
}}
id={`switchChannel_${channel.name}`}
data-testid={channel.name}
aria-label={displayName || channel.name}
{...Suggestion.baseProps}
>
{icon}
Expand Down
2 changes: 1 addition & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3340,7 +3340,7 @@
"quick_switch_modal.channelsShortcut.windows": "- CTRL+K",
"quick_switch_modal.help": "Start typing then use TAB to toggle channels/teams, **▲▼** to browse, **ENTER** to select, **ESC** to dismiss.",
"quick_switch_modal.help_mobile": "Type to find a channel.",
"quick_switch_modal.help_no_team": "Type to find a channel. Use **▲▼** to browse, **ENTER** to select, **ESC** to dismiss.",
"quick_switch_modal.help_no_team": "Type to find a channel. Use **UP/DOWN** to browse, **ENTER** to select, **ESC** to dismiss.",
"quick_switch_modal.switchChannels": "Switch Channels",
"quick_switch_modal.teams": "Teams",
"quick_switch_modal.teamsShortcut.mac": "- ⌘⌥K",
Expand Down

0 comments on commit d5ed931

Please sign in to comment.