debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[Accessibility] Search sources autocomplete functionality needs to be accessible

Open yzen opened this issue 9 years ago • 13 comments

Some background can be found here. Keyboard accessibility is pretty great, missing is the semantics:

  • [ ] aria-autocomplete="list" must be used in the search input field
  • [ ] aria-controls should be used in the search input to point to the result-list
  • [ ] aria-expanded should be used appropriately when the results are shown/hidden
  • [ ] result-list should be an aria-live="polite" so screen readers could be notified when new results are rendered
  • [ ] result-list should have a role of 'listbox' and each individual result should have a role of 'option'.
  • [ ] aria-activedescendant (set on the listbox) should be pointing to the ID of the currently highlighted result item.
  • [ ] Ideally, for each result item the labeling should be as follows: aria-labelledby should be pointing to ".title" child and aria-describedby should be pointing to ".subttitle". This will require assigning ID's to each one of them. This will help with the unnecessary verbosity of each result item where the screen reader would not have to utter a complete path for each one of them.

Screenshot

Screen Shot 2017-09-18 at 8.08.43 PM.png

yzen avatar Sep 18 '17 15:09 yzen

aria-autocomplete="list" must be used in the search input field

diff --git a/src/components/shared/SearchInput.js b/src/components/shared/SearchInput.js
index b8966fa1..4dd1a66c 100644
--- a/src/components/shared/SearchInput.js
+++ b/src/components/shared/SearchInput.js
@@ -118,6 +118,7 @@ class SearchInput extends Component {
       onKeyUp,
       onFocus,
       onBlur,
+      "aria-autocomplete": "list",
       placeholder,
       value: query,
       spellCheck: false,

yzen avatar Sep 19 '17 13:09 yzen

Ideally, for each result item the labeling should be as follows: aria-labelledby should be pointing to ".title" child and aria-describedby should be pointing to ".subttitle". This will require assigning ID's to each one of them. This will help with the unnecessary verbosity of each result item where the screen reader would not have to utter a complete path for each one of them.

diff --git a/src/components/shared/ResultList.js b/src/components/shared/ResultList.js
index f50bb20e..4edc3d64 100644
--- a/src/components/shared/ResultList.js
+++ b/src/components/shared/ResultList.js
@@ -40,6 +40,8 @@ export default class ResultList extends Component {
       key: `${item.id}${item.value}${index}`,
       ref: index,
       title: item.value,
+      "aria-labelledby": `${item.id}-title`,
+      "aria-describedby": `${item.id}-subtitle`,
       className: classnames("result-item", {
         selected: index === selected
       })
@@ -47,8 +49,8 @@ export default class ResultList extends Component {
 
     return (
       <li {...props}>
-        <div className="title">{item.title}</div>
-        <div className="subtitle">{item.subtitle}</div>
+        <div id={item.id + "-title"} className="title">{item.title}</div>
+        <div id={item.id + "-subtitle"} className="subtitle">{item.subtitle}</div>
       </li>
     );
   }

yzen avatar Sep 19 '17 14:09 yzen

/claim

Hello, @RobertHosking, @sanginovs, @davisv007 and I will be working on it. @emmet0r will be helping us out as well.

tahmidefaz avatar Oct 09 '17 23:10 tahmidefaz

Thanks for claiming the issue! :wave:

Here are some link for getting setup, contributing, and development tips. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Oct 09 '17 23:10 claim

Welcome @tahmidefaz, @RobertHosking, @sanginovs, @davisv007!

jasonLaster avatar Oct 10 '17 13:10 jasonLaster

@jasonLaster We've been able to add most of the attributes from the checklist to the search input and result list. As we test our changes, could you tell me what the kind of behavior we should expect from the screen reader? Everyone in the team is using a distro of linux, which comes with Orca, if that matters. Thank you.

davisv7 avatar Nov 16 '17 00:11 davisv7

@davisv007 You would want to test keyboard interactions with Orca enabled, things like focusing on all focusable (clickable) controls, activating them with Enter/Space. For every change in current screen reader focus, Orca should announce information about what's being focused: type of the control, its name, optionally (depending on the type) value, relation etc.

yzen avatar Nov 16 '17 03:11 yzen

/claim

sanginovs avatar Nov 30 '17 19:11 sanginovs

Thanks for claiming the issue! :wave:

!!! Please check your email and confirm the invitation

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Nov 30 '17 19:11 claim

/claim

davisv7 avatar Nov 30 '17 19:11 davisv7

Thanks for claiming the issue! :wave:

!!! Please check your email and confirm the invitation

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Nov 30 '17 19:11 claim

/claim

RobertHosking avatar Nov 30 '17 21:11 RobertHosking

Thanks for claiming the issue! :wave:

!!! Please check your email and confirm the invitation

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Nov 30 '17 21:11 claim