SuffolkLITLab / docassemble-AssemblyLine

Quickly go from a paper court form to a runnable, guided, step-by-step web application powered by Docassemble. Swap out branding and pre-built questions to meet your needs.
https://suffolklitlab.org/docassemble-AssemblyLine-documentation/
MIT License
41 stars 5 forks source link

Combobox Accessibility Issues #548

Open BryceStevenWilley opened 2 years ago

BryceStevenWilley commented 2 years ago

Came across a use of a combo box in ILAO's Fee Waiver interview when doing an accessibility audit. There are a few accessibility issues I found when using it with a screen reader and keyboard:

The combobox is a separate bootstrap plugin that we would have to patch separately from docassemble. There haven't been any substantive merged PRs since 2019, so our best bet is to patch it ourselves, see if the author has the time to review and merge, and if not, convince Jonathan to use our fork instead.

Here's an image of what the combobox looks like, and some example code to try it out.

Screenshot from 2022-08-05 15-22-45

question: |
  What year were you born?
fields:
  - Year of birth: birth_year
    input type: combobox
    datatype: integer
    maxlength: 4
    min: ${ today().year-120 }
    max: ${ today().year }
    code: |
      reversed(range(today().year-120, today().year+1))
BryceStevenWilley commented 2 years ago

Since this is (IMO) a pretty big accessibility issue, and there are a number of things to patch (that I would have to figure out, given I'm not a front-end expert yet), I might recommend that our interviews avoid combo box selections (at least the e-filing ones).

BryceStevenWilley commented 2 years ago

From our conversation at the coding deep-dive:

Our priorities here should be to:

BryceStevenWilley commented 2 years ago

Did a little more searching for other plugins, and unfortunately the only one I found was https://github.com/cchantep/bootstrap-combobox, which isn't really a combobox, it's just a dropdown. There are a lot of dropdown plugins, but not a lot of combo boxes.

It's not a plugin, but w3 does have a (not-production ready) version, which looks good, but likely won't be a drop-in-replacement when trying to get the styles we want.

BryceStevenWilley commented 2 years ago

Some quick updates here: I forgot that docassemble already it's own fork of most things, including the bootstrap-combobox plugin. So that makes it easier to merge into docassemble more quickly (might also merge upstream if I have the time).

Realizing this I was able to fairly quickly make the combobox much more accessible, with the right aria properties and roles. The code is fairly done, and in this commit. I have an fairly extensive testing plan though, because I want to do this right on mobile and different operating systems, and am kinda doing it on my free time to learn more about front-end stuff.

Keeping track of the testing plan here, cause I might as well.

OS/platforms

Behaviors to test

Checked behaviors work on all tested browsers so far.

BryceStevenWilley commented 1 year ago

https://github.com/jhpyle/docassemble/pull/581 was merged upstream and released as 1.4.13. However there are a few remaining things to address here:

If you enter an invalid number and navigate to continue, the validation message pops up, but nothing is read out on with the reader (at all). If you navigate back to the combo box, it won't read out the issue either. If you just didn't enter anything it will read out "this field is required".

nonprofittechy commented 1 year ago

@BryceStevenWilley can we get an update on upstream status. I've seen at least one more changelog entry dealing with combobox. Is it still not fully accessible?

BryceStevenWilley commented 1 year ago

None of those changes have dealt with the known issues listed in https://github.com/SuffolkLITLab/docassemble-AssemblyLine/issues/548#issuecomment-1292238147. Mac / VoiceOver support is the biggest one remaining; I'd be willing to mark this as closed if we could get that working. I haven't had to time to dive into VoiceOver / Safari compatibility stuff though.