DropDownList fails accessibility requirement WCAG 1.3.1

2 Answers 552 Views
DropDownList
David
Top achievements
Rank 1
Iron
Iron
Veteran
David asked on 07 Jul 2021, 06:05 AM | edited on 07 Jul 2021, 06:39 AM

Hi,

The KendoReact DropDownList fails WCAG 1.3.1 when not expanded as per axe DevTools. This can be seen on the Getting Started page for the DropDownList https://www.telerik.com/kendo-react-ui/components/dropdowns/dropdownlist/

The issue is: "Ensures elements with an ARIA role that require child roles contain them" and the proposed resolution is "Required ARIA child role not present: option".

The HTML from the basic DropDownList on the Getting Started page is as follows:

<span role="listbox" tabindex="0" class="k-dropdown-wrap" aria-haspopup="true" aria-expanded="false" aria-owns="1aaf8d2f-7bcc-4876-82cf-6b8ec7bfb31f">
	<span class="k-input"></span>
	<span class="k-select">
		<span class="k-icon k-i-arrow-s"></span>
	</span>
	<select tabindex="-1" aria-hidden="true" style="opacity: 0; width: 1px; border: 0px; z-index: -1; position: absolute; left: 50%;">
		<option></option>
	</select>
</span>

It appears as if the issue is that the <option> is not a direct descendant of the <span> with the "listbox" role. The <span> has an aria-owns element which can be used to resolve this issue, but it contains a unique identifier that doesn't appear anywhere else on the page.

I have done two tests: I have shifted the role="listbox" attribute to the <select> and I have left the role on the outer <span> and added an id="unique-identifier" to the <option>. In both cases the issue is resolved. However, the issue may also be that when hidden the outer span shouldn't have role="listbox".

I believe this is a bug.

Kind regards,

David

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 07 Jul 2021, 10:31 AM

Hello, David,

Thank you for the details.

Indeed we render this list only when the DropDownList is opened. In general, accessibility is needed, so when this component is used, the screen reader can read the available options. When the DropDownList is not used/opened this information is not used as well. I understand that the tool scans the HTML and reports the missing attributes, but they will be rendered when needed.

Still, if this creates issues, we can make an approach to dynamically render a hidden span will the same options and attributes which will be rendered when the DropDownList is close and hidden when the open the DropDownList.

We can render it under the DropDownList and dynamically show/hide it on the DropDownList onClose and onOpen events:

https://www.telerik.com/kendo-react-ui/components/dropdowns/api/DropDownListProps/#toc-onclose

https://www.telerik.com/kendo-react-ui/components/dropdowns/api/DropDownListProps/#toc-onopen

Regards,
Stefan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

David
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 07 Jul 2021, 10:52 AM | edited

No problems, thanks Stefan. However, please note that according to W3C best practice is to assign the listbox role to the hidden element e.g. https://www.w3.org/TR/wai-aria-practices-1.1/examples/listbox/listbox-collapsible.html
Stefan
Telerik team
commented on 07 Jul 2021, 11:05 AM

Yes, we do add it to the popup list:

The same can be added to the custom element if needed

David
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 07 Jul 2021, 11:08 AM | edited

Thanks Stefan,

In that case shouldn't the "listbox" role be removed from the outer span? This is being reported as an issue because of the role="listbox" on the outer span when the dropdownlist is collapsed.

Also, when using a default item, that item doesn't form part of the underlying <ul> and as such isn't included in the list and isn't vocalised by screen readers https://www.telerik.com/kendo-react-ui/components/dropdowns/dropdownlist/default-item/
0
Stefan
Telerik team
answered on 08 Jul 2021, 12:45 PM

Hello, David,

We have discussed this in the team and decided to log a research task in GitHub to address these cases and improve the component accessibility:

https://github.com/telerik/kendo-react/issues/996

Regards,
Stefan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Daphne
Top achievements
Rank 1
commented on 11 Dec 2023, 09:57 AM

Hello,

 

Is there a workaround for the "aria" owns issue? Looking at the github issue above, I can't see a resolution.

 

Thanks you.

Ivaylo
Telerik team
commented on 13 Dec 2023, 11:00 AM

Hello, David,

I tested the DropDownList with v7.0.1 using axe devtools and I could see that the `aria-owns` property is present in both the opened and the closed state. Can you please confirm if this is related to the faced issue, and if you are using the latest version of the component? In addition, I found that currently the DropDownList component reproduces only two errors on opened state (when its opened property is set to `true`): 

  • missing aria-controls
  • wrong aria-activedescendant value

 I logged them in the below GitHub issue, you can track it here:

Moreover, I updated your Telerik Points accordingly as a small token of gratitude for your report.

If you have any further questions or concerns on this matter, please let me know.

Regards,
Stefan
Progress Telerik
Tags
DropDownList
Asked by
David
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Stefan
Telerik team
Share this question
or