[ui5-li] Unable to set accessibleRole attribute for resulting ui5-icon when using icon property
See original GitHub issueBug Description
Hi Team,
When icon property for StandardListItem is set, there is no option to set the accessibleRole (https://github.com/SAP/ui5-webcomponents/pull/4548) property for the resulting ui5-icon.
When we specify action-settings as the value for the icon parameter, the resulting svg image for this list item has a default img role set to it.
<ui5-icon part="icon" class="ui5-li-icon" name="action-settings" ui5-icon="">
<svg class="ui5-icon-root" viewBox="0 0 512 512" focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" tabindex="-1" role="img" aria-label="Settings">...</svg>
</ui5-icon>
When a screen reader is used to navigate the application, the settings list item is announced twice as “Settings settings”.
Expected Behavior
accessibleRole should be a config option on the ui5-li, that can be passed down to ui5-icon when the icon property for StandardListItem is set. Labels should be announced only once when using screen reader to navigate within the application.
Steps to Reproduce
- Go to https://codesandbox.io/s/wonderful-burnell-m62vm?file=/index.html
- Using screen reader, navigate through the screen
Context
- UI5 Web Components version: 1.1.0
- OS/Platform: All
- Browser: All
- Affected component: ui5-li
Priority
- Low
- Medium
- High
- Very High
The priority indicates the severity of the issue. To set the appropriate priority consider the following criteria:
- Breaks entire application or system - High or Very High
- Accessibility issue - Medium or High
- Functional issue - Medium or High
- Visual issue - Low or Medium
Note: The priority might be re-evaluated by the issue processor.
Stakeholder Info (if applicable)
- Organization: SF
- Bussiness impact: Medium
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (8 by maintainers)

Top Related StackOverflow Question
Hello @dkris from our offline discussions I know that you need to control/define the
accessibleRoleof the internally rendered ui5-icon, rendered inside the StandardListItem. Is that all? Please comment if I miss something. Meanwhile, I will forward your request to the team.Hello @SAP/ui5-webcomponents-topic-p it seems that our SF colleagues, that recently requested an API for the ui5-icon, are using the StandardListItem, where the icon is not accessible directly and they need to control the
accessibleRoleof the ui5-icon, rendered inside the StandardListItem. We either need to expose a slot, or property. similar to the FCL, ShellBar, allowing to set aria attrs to the internals.Hello @dkris ,
As the last mention PR is already merged and the issue is fixed, I am closing the GitHub issue.
Best regards, Tereza