-
Notifications
You must be signed in to change notification settings - Fork 378
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
RFC - Upcoming a11y design #293
Comments
The main point of this design for me is that is consistent. |
I think we're working really hard to pound a square peg into a round hole.
That's not where the search results live here, which is why I was suggesting in the other thread that we dispense with |
@jmacqueen Yes, on the dropdown I think the looks ok. |
I prematurely sent the earlier post. It's updated now. But the answer is More amazing diagrams to follow. |
I'm looking at the multiple select now. I have a little time before I get pulled into more actual work 😄 |
Please see the Authoring Practices Guide's section on autocomplete for more information about keyboard handling. ps. there is a discussions going on at the moment regarding combobox: ACTION-1490 proposal says good bye to the "inline" notion for combobox |
Multi-select key pointsFirst pass In the trigger
In the dropdown
|
See cibernox/ember-power-select#293 (comment) - [x] `role=button` - [x] `aria-haspopup=true` tells AT to treat the trigger as a host for conditional content - [x] `aria-expanded=true/false` tells AT that conditional content is expanded - [x] `aria-pressed=true/false` tells AT that the `button` is in a pressed or 'true' state (technically different from whether the conditional content is expanded, but in practice usually the same). - [x] `aria-controls=<id of dropdown>` is all we need since there is no requirement that the trigger element own or have a direct DOM relationship to the dropdown
@jmacqueen I've implemented all tasks but two:
|
@cibernox I see the value in using aria attributes for styling. However, css attribute selectors are known to perform badly in IE browsers. I'm not saying this by my own experience, unfortunately. I've seen that angular material recently changed their layout styles to use class selectors instead of attribute selectors. See https://material.angularjs.org/latest/layout/introduction in the section "under-the-hood". |
@cibernox "Search Box: include close button" means that the search box in use in multi-select also has its own close button and it would have the same structure as the close button in each of the selections. Sorry that was unclear. @miguelcobain From my reading (insert first thing that Google put up here as an example), I haven't seen any benchmarking of attribute selectors that shows an appreciable difference in performance unless you have well over 20,000 elements on the page. This, coupled with the WCAG recommendation to style against the WAI-ARIA attributes wherever possible (see ARIA Authoring Practices, number 7), makes for a pretty strong recommendation to use the aria attribute selectors. It has problems in IE6, but that's not even supported by Microsoft any more and I'm well past caring about it 😄 |
@jmacqueen more context:
I'm not sure this results in a significant perf penalty, but it might be worth to try to quantify that penalty. |
Ah. After looking at what they were replacing. That project was using a huge number of unqualified attribute selectors, which is the equivalent of doing a global select and then an attribute select on every rule. Very, very, very slow combination. And they had a TON of them in the layout module. As long as there is some qualifier (e.g. |
@jmacqueen got it! Thanks for the explanation. |
@jmacqueen Thanks for investigating that. I never considered css selector performance as a critical thing before. One downside of of using selectors like I could have mantained the classes but I didn't because
Let's see how it goes. |
Mmm.. there is no close button. I think that the button you see in chrome is because it's added by default by blink and webkit to |
Hah! Yes! That's exactly what I mean. Oops. In that case, it needs no special treatment. The browser will handle populating the AT (as it does for any other built-in interactive element). |
re: CSS...how are you limiting your |
I think I'm only targeting aria-disabled on the options and the trigger. |
Is there a way to pass through
|
@jmacqueen PR #254 should be resuscitated for that. @martndemus are you still interested in finish that? |
@cibernox Not really sure when I can commit to this, but if I have some time I sure would like to help 😄 |
Ignore all of that. I spoke too quickly from a quick glance at the DOM. Looks like things are probably in the right place. |
After some comments in other issues, I've decided to gather together all the a11y design and best practices.
I've also found this example to be particularly enlightening.
NOTE: The image deliberately omit the roles of the options of the list because seems to be a consensus that are
role=option aria-selected=true/false aria-current=true/false aria-disabled=true/false
. This focuses on what wires the trigger, the searbox and the list of options together only.Starting with the most basic component, Ember Basic Dropdown, the a11y is relatively simple.
On top of this we build the power-select and power-select-multiple
I'm also omitting
aria-description
,aria-label
.cc @jmacqueen @martndemus
In case this is the path taken:
role=listbox
.role=group
role=option
.aria-selected=true
.aria-current=true
.aria-disabled=true
.role=combobox
.aria-expanded=true
,aria-owns=id-of-the-listbox
andaria-autocomplete=list
.aria-expanded=true
,aria-owns=id-of-the-listbox
andaria-autocomplete=list
. aria-expanded has to be false/true depending on if the options are visible?role=button
aria-owns=<id-of-dropdown>
aria-pressed=true/false
. Should we removearia-expanded
then?aria-disabled=true
when passeddisabled=true
to the component.aria-haspopup=true
.aria-labelledby
(applies to the trigger).aria-describedby
(applies to the trigger)aria-requited
(applies to the trigger)aria-invalid
(applies to the trigger)The text was updated successfully, but these errors were encountered: