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

Update TopLeftMenu for accessibility: Keyboard shortcut, reduced screen reader noise #2994

Merged
merged 8 commits into from
May 21, 2019

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented May 17, 2019

Reviewer: The commits are best reviewed individually as they tell a story.

See element-hq/element-web#9747 and related issues.

For a tour of how it sounds now, prepare some headphones and have a watch: https://www.youtube.com/watch?v=1r3wmGEYeek

turt2live added 5 commits May 17, 2019 15:25
We use tabIndex to make elements selectable and therefore focused by screen readers. Doing this draws a blue border (in chrome at least) around the element - in some cases, we don't want this.
To avoid having them read out the user's ID
We use a trick with refs to automatically focus the element, also making use of mx_HiddenFocusable to hide the unnecessary outline. 

The menu itself has been restructured to hide some elements from screen readers (reduce noise) and to have a single unordered list. Screen readers mention when the user "enters" a list, and each item was previously saying "enter list <action>" when it should have just been "<action>".

By focusing automatically, the keyboard can be used to go up/down the menu as may be expected by keyboard users.
@turt2live turt2live requested a review from a team May 17, 2019 21:44
@jryans jryans requested review from jryans and removed request for a team May 20, 2019 12:06
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broadly seems good, but a few questions.

res/css/_common.scss Show resolved Hide resolved
src/components/structures/LoggedInView.js Show resolved Hide resolved
src/utils/Accessibility.js Outdated Show resolved Hide resolved
@turt2live turt2live self-assigned this May 20, 2019
@turt2live
Copy link
Member Author

@jryans please take another look. We don't have a thing to componentDidMount on for the context menu, so we have to keep using the ref hack (unfortunately). Have added a bunch of comments to hopefully solve some future questions.

@turt2live turt2live requested a review from jryans May 21, 2019 03:08
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let's give it a try.

@turt2live turt2live removed their assignment May 21, 2019
@turt2live turt2live merged commit 907c7ed into develop May 21, 2019
@turt2live turt2live deleted the travis/screenreader/topleftmenu branch May 21, 2019 15:52
turt2live added a commit that referenced this pull request Sep 17, 2019
Fixes element-hq/element-web#10899

The `tabIndex` is required to make the thing actually focusable. This is the same trick employed in #2994
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants