SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.46k stars 253 forks source link

[Select]: a11y collapsed Select does not have the role of collpased #9332

Open AlexYanSap opened 4 days ago

AlexYanSap commented 4 days ago

Bug Description

It's an incident from the customer that the collapsed select should have the role of the collapsed as recommended by the https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.

I noticed the SR did announce the collapsed state even though we have not set the role as recommended.

image

Affected Component

Select

Expected Behaviour

Ensure role should be button collapsed. image

Isolated Example

https://sap.github.io/ui5-webcomponents/components/Select/

Steps to Reproduce

  1. use Edge (123.0.2420.81 (Official build) (64-bit))
  2. focus on any of the select on the Isolated Example Page
  3. no collapsed role is set on the Select

Log Output, Stack Trace or Screenshots

No response

Priority

None

UI5 Web Components Version

1.24.1

Browser

Edge

Operating System

No response

Additional Context

I'm from SFSF

Organization

SAP SF

Declaration

kineticjs commented 3 days ago

Hi @AlexYanSap,

Can we ask the customer to give more details i.e. indicate more precisely their concern.

The spec https://www.w3.org/TR/wai-aria/#widget_roles does not list any role named "collapsed".

  1. "Collapsed" is rather a state and it is indicated with the aria-expanded attribute: https://www.w3.org/TR/wai-aria/#aria-expanded The ui5-select currently updates that attribute whenever the dropdown in shown/hidden, so the SR announces the new state
  2. By spec, the role should be button only if the select is a button that opens a dropdown, otherwise (as is the case of ui5-select) it should be combobox/listbox. Currently the ui5-select has role comboboxhttps://www.w3.org/TR/wai-aria/#combobox