feat(ui5-list): inherit list item aria roles from accessibleRole#13463
Open
plamenivanov91 wants to merge 1 commit intomainfrom
Open
feat(ui5-list): inherit list item aria roles from accessibleRole#13463plamenivanov91 wants to merge 1 commit intomainfrom
plamenivanov91 wants to merge 1 commit intomainfrom
Conversation
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
Collaborator
|
🚀 Deployed on https://pr-13463--ui5-webcomponents-preview.netlify.app |
NakataCode
reviewed
May 5, 2026
| * **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" |
Contributor
There was a problem hiding this comment.
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}`; |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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