-
Notifications
You must be signed in to change notification settings - Fork 273
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
base: main
Are you sure you want to change the base?
Conversation
packages/main/src/ListItem.ts
Outdated
@@ -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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Fixes: #10914