Skip to content
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

fix(ui5-li): announce active state #11064

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dobrinyonkov
Copy link
Contributor

Fixes: #10914

@@ -481,6 +482,7 @@ abstract class ListItem extends ListItemBase {
ariaHaspopup: this.accessibilityAttributes.hasPopup,
setsize: this.accessibilityAttributes.ariaSetsize,
posinset: this.accessibilityAttributes.ariaPosinset,
listItemAriaLabel: this.typeActive && document.activeElement === this ? ListItem.i18nBundle.getText(LIST_ITEM_ACTIVE) : undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need to set it only when the active element is the current list item?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made that by analogue to the sap.m.List. Just talked to the team and they said -

"list structure can be quite complex containing a title, description text, info, count etc., have a look at the following sample: https://sapui5untested.int.sap.eu2.hana.ondemand.com/uilib-sample/test-resources/sap/m/List.html?sap-ui-language=en&sap-ui-theme=sap_horizon&sap-ui-rtl=false
In order to announce all this information properly the list has always used custom announcements. To avoid creating these announcements for all items initially (considered as unnecessary overhead) the custom announcements are added for each item individually on focus"

I guess we still don't have this overhead in our list and can make it a static text.

Copy link
Contributor

@nnaydenow nnaydenow Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it going to be read out by the screen readers if always render that text not only when the list item is focused?

I'm thinking about case where we have button inside list item and that button is focused? Also similar case is when we there is selection mode with selection component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[List]: Screen reader does not announce list items as clickable
2 participants