mat-select is not level A compliant according to AInspector WCAG

Eugenia Pais

I'm using Angular material in my website and trying to make it WCAG level A compliant. Doing some checks with the AInspector (extension for Firefox) seems the mat-select component don't have aria-controls, aria-expanded attributes, but looking at the HTML generated those aria attributes are there, you can verify this here. My question is if I'm missing something in the configuration, or definitely mat-selects are non level A compliant to the WCAG rule 4.1.2?

mat-select AInspector check

slugolicious

The problem with accessibility tools is that they're advertised as being simple to use and you just need to read the results to fix things but it's extremely helpful if you have some accessibility background to accurately interpret the results. Accessibility tools are not infallible and many report false positives which is where accessibility knowledge comes in handy. You have to know how to read the results and how to filter out the junk. Accessibility tools are just written by developers that are using their interpretation of WCAG to generate results. A lot of WCAG can be subjective and one accessibility expert might say something fails whereas another says it passes.

With that said, in your particular case, when I run the basic example on the demo page with a screen reader, it correctly says "collapsed" when I navigate to the "favorite food" selector and then says "expanded" when I press spacebar to open it. That's a good sign that it's coded correctly. I can then arrow up/down through the dropdown list and it reads the value of the element as well as "1 of 3" (depending on your screen reader). These are all good signs.

If I look at the code, the <mat-select> has a plethora of ARIA attributes. Perhaps too many. ARIA is like salt. A little enhances the flavor but too much spoils it. It has:

  • aria-autocomplete="none"
  • aria-haspopup="true"
  • aria-labelledby="[list of ids]"
  • aria-expanded="false"
  • aria-required="false"
  • aria-disabled="false"
  • aria-invalid="false"

The last three are not needed. Having "false" values for those is the same as not having them at all.

One of the important ones (well, I guess they're all important), is aria-expanded. Setting it to false says that you have an expandable thing but that it's currently collapsed. That's a trigger to me (as a screen reader user) that I can press space to expand it. <mat-select> has it so I'm not sure why the tool is complaining about it.

It also has:

  • tabindex="0"
  • role="combobox"

Both of those are good.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Contrast requirements for WCAG level A?

sort mat-table according to the selected value of mat-select

How can you make a table with nested tables WCAG AA compliant

pandas multiindex select one header value according to another header and a level

Does WCAG 2.0 Level AA inherit requirements of Level A?

WCAG 2.0 (Level AA) - Input element error - No input on code

Change alpha level according to variables

mat select not in certain position

Filter on a mat-select

mat-select with checkboxes

Do we need alt text for Instagram feed to meet WCAG 2.0 AA compliance level?

Is it important to have relative units to ensure Section 508 / WCAG 2.0 Level AA compatibility?

Is there a color that meets the WCAG 2.0 contrast requirements for both black and white (Level AA)?

mat-icon in multiple mat-select

Render wpf margin according to current zoom level

R- split histogram according to factor level

Merging multiple Netcdf files according to the vertical level

Rails f.select include blank not VPAT compliant

Adding mat-divider to mat-select/mat-option

Select Rows According to Time Window

Select checkbox according to clicked item

select ascending or descending according to a parameter

Select according to position and additional data

Filter Select according to NULL values

Select subset of a raster according to values

Edit text according to select input

Select interface implementation according to parameter

Show different select according to the selected option of a select

Select row by level of a factor