[Accessibility] Search sources autocomplete functionality needs to be accessible
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

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,
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>
);
}
/claim
Hello, @RobertHosking, @sanginovs, @davisv007 and I will be working on it. @emmet0r will be helping us out as well.
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!
Welcome @tahmidefaz, @RobertHosking, @sanginovs, @davisv007!
@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.
@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.
/claim
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
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
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!