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.5k stars 258 forks source link

[SF][A11y][ui5-combobox]: Group header should not be announced as a part of the list item #6736

Closed sfsf-xweb-sh closed 10 months ago

sfsf-xweb-sh commented 1 year ago

Bug Description

Hi Colleague, We use ui5 web component Combobox with grouping of items in OMP project, and got an a11y ticket, the group header shouldn't be announced as a part of the item. For example, in following screenshot, "List item 5 of 11" shouldn't be announced after Group Header B.

Screenshot 2023-03-20 at 10 10 24

Below is combobox announcement record: https://user-images.githubusercontent.com/78520316/226230802-df26e2cd-6ca4-48a2-9f02-0bc072a4044c.mp4

Please help check it. Thanks! Josephine Su

Affected Component

ui5-combobox

Expected Behaviour

No response

Isolated Example

No response

Steps to Reproduce

Use screen reader Jaws or NVDA to test combobox with group items (https://sap.github.io/ui5-webcomponents/playground/components/ComboBox/)

Log Output, Stack Trace or Screenshots

No response

Priority

High

UI5 Web Components Version

1.11.0

Browser

Chrome

Operating System

No response

Additional Context

No response

Declaration

s-todorova commented 1 year ago

Hello @SAP/ui5-webcomponents-topic-rl,

The ui5-combobox does not announce number of items correctly if there is grouping of items. Instead it counts the group header as items and announces them as such. The issue is reproducible on the playground Combobox page - https://sap.github.io/ui5-webcomponents/playground/components/ComboBox/.

Could you please take a look at this issue?

Best regards, Siyana

elenastoyanovaa commented 1 year ago

Hello @SAP/ui5-webcomponents-topic-p , @dobrinyonkov ,

The announcement of the groups comes from the ui5-list. I see that the implementation of the groups is similar to the one in the sap.m.List, so maybe this should be discussed with the table colleagues, as well as Stefan Schnabel. The question is: Do we expect to have the group items taken into account in the list size or they should not be read out as regular items?

Kind Regards, Elena

dobrinyonkov commented 1 year ago

Hello @SAP/ui5-webcomponents-topic-rl, sorry for the late reply. This was discussed with Stefan Schnabel and we've decided to remove the counting information for the group header list items. However, as for the ui5-combobox, the focus never leaves the input element, so the combobox has its own implementation of the announcement, using the invisible message service:

https://github.com/SAP/ui5-webcomponents/blob/a505bfaa8a7e2653b274b2ac77faf9bded78caea/packages/main/src/ComboBox.ts#LL1062C4-L1062C4

if (isGroupItem) {
    announce(`${groupHeaderText} ${currentItem.text} ${itemPositionText}`, InvisibleMessageMode.Polite);

Kind Regards, Dobrin

2bno1 commented 1 year ago

@niyap It seems that ground header is still counted as items in the latest version. I checked https://sap.github.io/ui5-webcomponents/playground/?path=/story/main-combobox--grouping-items, the JAWS announced as below:

Screenshot 2023-08-14 at 15 00 58 Screenshot 2023-08-14 at 15 01 46

The expected announcement should be "Argentina List Item 2 of 8".

It seems the code below need to be changed. The 3rd parameter (this._filteredItems.length) pass to ComboBox.i18nBundle.getText need to be subtracted with the count of group header. https://github.com/SAP/ui5-webcomponents/blob/c6e6a7b5674e4934e590e66d391b731c29101e4a/packages/main/src/ComboBox.ts#L1062

petyabegovska commented 10 months ago

I reopen the issue as additional fix in combobox is needed.

Cheers, Petya