Visitar URL original
fix(ui5-list): announce grouped list item counts correctly by NakataCode · Pull Request #14228 · UI5/webcomponents · GitHub
Skip to content

fix(ui5-list): announce grouped list item counts correctly - #14228

Open
NakataCode wants to merge 3 commits into
mainfrom
list-group-item-count-announcement
Open

NakataCode wants to merge 3 commits into
mainfrom
list-group-item-count-announcement

Conversation

@NakataCode

@NakataCode NakataCode commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

A ui5-list containing a single ui5-li-group was announced as a "list with 1 item" because the group header was exposed as the list's only listitem, and the real items received inflated positions.

The group header is now a heading (role="heading" with aria-level) rather than a listitem, so it is announced but not counted among the list's items. Each group is wrapped in a labelled role="group", and under the default List role its items are placed in an inner role="list" so they are counted within the group rather than by the outer list.

As a result:

  • A single-group list is announced with the real item count.
  • The group header is read as a heading (not a counted item).
  • The outer list no longer adds a "contains N sub groups" summary.

When the list's accessible-role is ListBox, the group instead keeps its items as direct options of the role="group" (no intervening role="list", header exposed as role="none"), so they stay part of the listbox.

The group's role="group" and inner role="list" are labelled with headerAccessibleName when set, falling back to the visible headerText.

@sap-ui5-webcomponents-release

Copy link
Copy Markdown

@plamenivanov91 plamenivanov91 left a comment

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.

Hello Niki,

Seems like the change is fixing the issue, but here is what I found with Opus 4.8:

The 5 findings, each re-verified on the merged base

  1. ListBox + group regression - CONFIRMED (real, and I nearly got this wrong). Live a11y tree, ListBox-role list with a group:

main: listbox > option "Ascending", option "Descending" (correct options)
PR: listbox > heading + listitem "Ascending", listitem "Descending"
The items still carry role="option" in the DOM, but the PR's new

sits between the listbox and its options, orphaning them, so the browser drops them to listitem. Mid-review I tried to retract this from the static diff (reasoning the old empty role="list"+aria-owns already wrapped them) - the live tree proves that was wrong: on main the options are intact. Your insistence on reproducing caught a true positive I was about to kill. Scope caveat: shipped listbox components (ComboBox/Select) use SuggestionItemGroup, not ui5-li-group, so this hits manual accessible-role="ListBox" + ui5-li-group usage, which List.ts still explicitly supports (the LISTBOX_GROUP branch).

  1. Formatted-header group/list unlabelled + headerAccessibleName ignored - CONFIRMED (minor). For a slotted header, both div role="group" and div role="list" render aria-label=null. The public headerAccessibleName (ListItemGroup.ts:94) is never used by the template. The heading still carries the name, so impact is limited.

  2. Hardcoded aria-level="3" - CONFIRMED accurate (ListItemGroupHeader.ts:107). Discussion-level, not clearly a defect.

  3. Dead _groupItemCount - CONFIRMED. Three writes (585/619/1060), zero reads.

  4. Orphaned LIST_ROLE_LIST_GROUP_DESCRIPTION - CONFIRMED. No source references left; still in messagebundle.properties and generated defaults. (The LISTBOX_GROUP variant is still used at List.ts:850.)

@NakataCode
NakataCode deployed to netlify-preview November 10, 2026 12:58 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
netlify-preview — 458173af Deployed Nov 10, 2026 by NakataCode via deploy-preview #3727
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.

2 participants