-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ComboBox accessible #314
Comments
Adding some resources for review:
|
My understanding is that work on this issue is happening in phetsims/a11y-research#64, and we are almost there with an accessible combobox. |
@jessegreenberg, I have made further recommendations in phetsims/a11y-research#64 (comment) and am re-assigning these 2 issues for you to distribute. |
From meetings today, @emily-phet asked me to work on ComboBox for Molarity. My priorities align nicely to take a look at this in the next week or so. |
@terracoda pointed out in #363 design of the general ComboBox could impact this issue. I am not sure if a grid-like combobox was considered in our initial investigation, or whether a 2D combobox will be a totally different a11y implementation. |
Using design from phetsims/a11y-research#64. @emily-phet pointed out this morning that I should just implement the current structure. The first use case will be for Molarity. |
@zepumph, yes please make a general combobox for Molarity. I will investigate those other patterns as soon as possible, but not immediately. |
First step was to make ComboBox es6. |
@jessegreenberg pointed me to an old branch that had one implementation of it. I'm going to see how far putting that on master takes me, with the goal of eventually supporting the html in <div tabindex="-1"
id="container-for-labels">
<span id="listbox-static-label">Solute</span>
<button id="listbox-option-dynamic-label"
tabindex="0"
aria-haspopup="listbox"
aria-labelledby="listbox-static-label listbox-option-dynamic-label">Drink Mix</button>
</div>
<ul role="listbox" tabindex="0"
id="listbox" aria-activedescendant="option-1"
aria-labelledby="listbox-static-label"
style="list-style:none;">
<li role="option" id="option-1"
class="selected"
aria-selected="true">Drink mix</li>
<li role="option" id="option-2">Cobalt (II) nitrate</li>
<li role="option" id="option-3">Cobalt Chloride</li>
<li role="option" id="option-4">Potassium dichromate</li>
<li role="option" id="option-5">Gold (III) chloride</li>
<li role="option" id="option-6">Potassium chromate</li>
<li role="option" id="option-7">Nickel (II) chloride</li>
<li role="option" id="option-8">Copper sulfate</li>
<li role="option" id="option-9">Potassium permanganate</li>
<li role="option" id="option-10">Potassium dichromate</li>
</ul>
<!-- help text for combobox -->
<p>Change a solute and observe differences.</p> |
I made a first pass at this. Basically I converted the usages on the previous branch to master. Tomorrow I will work on reworking the structure to look like what is currently in ComboBox.md. |
@zepumph, if it is helpful there was an example in the a11y-research repo in the html sketches folder as well https://github.com/phetsims/a11y-research/blob/master/html-sketches/combobox/combobox.html. This might be the same HTML as what @jessegreenberg posted above and what's in the combobox.md file. There are several open issues about combobox, so I am having a little trouble weaving them together. |
Thanks @terracoda. I will use that link to combobox.html to base my current implementation on.
|
After the above commit, everything is implemented except active descendant. I will need to implement it first in phetsims/scenery#873. I'll try to get it done this afternoon, and will check back here afterwards with an update. |
Added aria-activedescendant support above. I am ready for combobox to be reviewed. @terracoda, @jessegreenberg, and @emily-phet please have a listen here: I took a brief listen on NVDA chrome and it sounds nice! Note that there aren't other labels on things, so just worry about the sound of the comboBox. You can also see in the a11y view that the HTML is the same as https://github.com/phetsims/a11y-research/blob/master/html-sketches/combobox/combobox.html. I still have a few todos in ComboBox.js, but I thought it would be good to get an idea about people's first impressions. My checklist of still to do's:
Note to @pixelzoom that molarity was only committed on to add the |
@pixelzoom, when you examine the example HTML in the design pattern do you see how this fits into the design pattern of a visual ComboBox? We have a button that has a dynamic label, so that when focus is placed on the Solute button, a blind user knows what Solute is currently selected before activating the actual Solute button. Once the user activates the button, a navigable list of solutes is popped up, and one of those solute items has to have focus (the one that was already selected). A user can then navigate the solute items and make their selection, or close the parent popped up list if they do not want to make a new selection. When the list of solutes is closed, the user's focus is returned to the Solute button which confirms which solute is selected. All of that information needs to be communicated and managed visually and non-visually. To complicate implementation, we don't even use the ARIA widget Designing for A11y is tricky and evolving. I am happy to see your interest in helping and guiding improving how we do things, so it can be as robust as possible from all perspectives. |
Thanks for the overview @terracoda, much appreciated. Again, I don't have any problem with the overall design or philosophy of how ComboBox is instrumented. It's the implementation that is overly complicated and lacking, and it doesn't need to be that way to support the design. |
@pixelzoom, great! I am sure @zepumph is going to fix it up nicely for us! |
I'm done with changes to ComboBox see #430. I preserved all TODO items related to this issue; search for "TODO sun#314". Following that work, I confirmed that a11y still works via the following test:
I did not succeed in factoring out Over to @zepumph. |
I addressed this TODO since it wasn't working with disposal in its current state. (Found while reviewing #430) // TODO: sun#314 is this how you have a reference to a listener to remove?
const handleKeyDown = this.listNode.addInputListener( { That used to be the way we referenced a11y listeners for removal, but this was changed some time ago. This was probably taken from the branch in #334. Now it looks like other non-a11y related listeners in scenery. |
From phetsims/molarity#37, we would like to make ComboBox accessible with keyboard navigation and description. We found recommendation from W3 for best practices and a working example:
https://www.w3.org/TR/2016/WD-wai-aria-practices-1.1-20160317/#combobox
http://demos.telerik.com/kendo-ui/combobox/keyboard-navigation
but it would be great to have a more solid mockup for the accessible HTML before we start adding to ComboBox. @terracoda is going to work on this and provide an example. Assigning to @terracoda, could you please paste links in this issue and reassign to me when ready?
The text was updated successfully, but these errors were encountered: