Skip to content

feat(ui5-list): inherit list item aria roles from accessibleRole#13463

Open
plamenivanov91 wants to merge 1 commit intomainfrom
li-expose-accRole
Open

feat(ui5-list): inherit list item aria roles from accessibleRole#13463
plamenivanov91 wants to merge 1 commit intomainfrom
li-expose-accRole

Conversation

@plamenivanov91
Copy link
Copy Markdown
Contributor

Map list accessibleRole values to child item roles (Menu -> menuitem, Tree -> treeitem, ListBox -> option) during list item preparation. Expose ui5-li accessibleRole as public and allow explicit item role to override inherited role. Add Cypress coverage for inheritance and precedence behavior. Add local test page and website sample documenting accessible-role inheritance and overrides.

Fixes #13264

Map list accessibleRole values to child item roles (Menu -> menuitem, Tree -> treeitem, ListBox -> option) during list item preparation.
Expose ui5-li accessibleRole as public and allow explicit item role to override inherited role.
Add Cypress coverage for inheritance and precedence behavior.
Add local test page and website sample documenting accessible-role inheritance and overrides.

Fixes #13264
@plamenivanov91 plamenivanov91 requested a review from NakataCode May 5, 2026 07:43
@plamenivanov91 plamenivanov91 changed the title fix(ui5-list): inherit list item aria roles from accessibleRole feat(ui5-list): inherit list item aria roles from accessibleRole May 5, 2026
@ui5-webcomponents-bot
Copy link
Copy Markdown
Collaborator

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview May 5, 2026 07:50 Inactive
* **Note:** If not set, the role is automatically inherited from the parent `ui5-list` based on its `accessible-role` property
* (e.g. `Menu` -> `MenuItem`, `Tree` -> `TreeItem`, `ListBox` -> `Option`).
* An explicitly set `accessible-role` on the list item takes precedence over the inherited role.
* @default "ListItem"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should the @default "ListItem" tag be updated to @default undefined? element.accessibleRole returns undefined when unset, even though the rendered role correctly falls back to "listitem" via the getter.

*/
@property()
accessibleRole: `${ListItemAccessibleRole}` = "ListItem";
accessibleRole?: `${ListItemAccessibleRole}`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should the type be narrowed to exclude Group? Using ${ListItemAccessibleRole} exposes the @Private Group member, which allows setting accessible-role="Group" on a <ui5-li> and renders role="group" on an interactive item.

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.

[Feature Request]: ListItem expose accessibleRole

3 participants