mitodl / ocw-hugo-themes

A Hugo theme for building OCW websites
BSD 3-Clause "New" or "Revised" License
4 stars 4 forks source link

sort out accessibility of the `FilterableFacet` component #383

Open alicewriteswrongs opened 2 years ago

alicewriteswrongs commented 2 years ago

This one needs a lot of work. This is, I think, what we need:

I think we can do something like the following:

<div id="topic" role="application" aria-roledescription="select multiple" aria-label="Topic Filter">
<ul id="" data-type="multiple" data-label="Topic">
  <li data-value="math">
    <label>
      math
      <input type="checkbox" data-value="math" tabindex="-1">
    </label>
  </li>
  <li data-value="art">
    <label>
      art
      <input type="checkbox" data-value="art" tabindex="-1">
    </label>
  </li>
  <li data-value="food">
    <label>
      food
      <input type="checkbox" data-value="food" tabindex="-1">
    </label>
  </li>
</ul>
</div>

This provides a listbox that the user can tab into, but once they're in there it's up and down arrow keys to navigate. We should investigate how to package together the filter searchbox with this sort of list UI. If each filter set requires two tab pushes to get through that might be acceptable (i.e. one to get to the filter, and then another to get to this list).

alicewriteswrongs commented 2 years ago

I'm un-assigning myself, but I did start some exploratory work on this on this branch: https://github.com/mitodl/ocw-hugo-themes/compare/ap/topic-widget so that could form the basis for resolving these issues. The main concerns are:

there are also probably some visual design accessibility things we should be concerned with here too, contrast and so on.