[ui5-search-item]: role="option" element contains interactive children (buttons), violating ARIA listbox/option semantics
Bug Description
In SearchItemTemplate.tsx, the root <li> of ui5-search-item is rendered with role="option" (line 20) but contains interactive/focusable children:
- the "delete"
ui5-button(rendered whendeletableis set), and - the
actionsslot, which is intended to hold interactive controls (e.g. buttons).
These items are placed inside a ui5-list configured with accessibleRole={ListAccessibleRole.ListBox} (SearchPopoverTemplate.tsx), so the accessibility tree is role="listbox" → role="option" → interactive button.
Per the WAI-ARIA specification, an element with role="option" must not contain interactive (focusable) descendants. option is only an allowed child of listbox, and the listbox/option pattern expects options to be non-interactive leaf nodes operated through the listbox's single-tab-stop + arrow-key model. Nesting buttons (or any focusable control) inside an option:
- produces an invalid/ambiguous accessibility tree,
- causes inconsistent exposure of the nested controls across assistive technologies (screen readers may not announce or may mis-handle them), and
- the nested controls are not reliably operable via the listbox keyboard interaction model.
The same concern applies to SearchItemShowMoreTemplate.tsx, which also uses role="option".
Affected Component
ui5-search-item (ui5-search) — packages/fiori/src/SearchItemTemplate.tsx (line 20); see also packages/fiori/src/SearchItemShowMoreTemplate.tsx.
Expected Behaviour
The accessibility semantics of a search item should be valid. An element exposed as role="option" should not contain interactive/focusable descendants. The structure/roles should be reworked so that items containing actions (delete button, actions slot) map to an ARIA pattern that legitimately allows interactive children, while remaining keyboard- and screen-reader-operable.
Steps to Reproduce
- Render a
ui5-searchwith suggestion items. - Add a
ui5-search-itemwithdeletableset (and/or content in theactionsslot). - Open the suggestions popover and inspect the accessibility tree (e.g. Chrome DevTools → Accessibility pane).
- Observe
role="listbox"→role="option"where theoptioncontains a focusablebutton, which is not permitted by the ARIAoptionrole.
Suggested Fix
The root cause is that the listbox/option widget pattern forbids interactive descendants. There are two viable ways to fix it; the right choice depends on whether per-item selection state must remain exposed to assistive technologies.
Option 1 — switch option → listitem (and listbox → list)
listitem is an ARIA document-structure role (not a widget role), so — unlike option — it permits interactive descendants such as the delete button and the actions slot. This is the simplest change and reuses the component's existing public API:
- Container (
SearchPopoverTemplate.tsx): set theListaccessible role toListAccessibleRole.List(→role="list") instead ofListBox. SearchItemTemplate.tsx: change the root<li>fromrole="option"torole="listitem". The nestedui5-button(delete) andactionsslot then become valid.SearchItemShowMoreTemplate.tsx: likewiserole="listitem".
Trade-off to be aware of: aria-selected is not a supported state on role="listitem" (it is only valid on option, row, gridcell, treeitem, tab, …). The current aria-selected={this.selected} binding (line 19) would therefore need to be removed, and per-item selection state would no longer be conveyed through that attribute.
- If the item's
selectedstate is effectively a visual highlight of the active suggestion, this is acceptable — the active suggestion can instead be communicated to screen readers viaaria-activedescendanton therole="searchbox"input (the input currently exposesaria-controls="ui5-search-list"only), which also aligns better with how a suggestion popup is announced. - If
selectedcarries real selection semantics that must be exposed, prefer Option 2.
Option 2 — migrate the popup to a single-column grid (preserves selection)
The WAI-ARIA Authoring Practices (APG) recommend the grid pattern when the items of a listbox/combobox popup must contain interactive elements, because a grid allows interactive controls inside its cells and retains aria-selected:
- Container (
SearchPopoverTemplate.tsx): expose it asrole="grid"instead ofListAccessibleRole.ListBox, with an accessible name viaaria-label. SearchItemTemplate.tsx: change the root<li>fromrole="option"torole="row"(keeparia-selected— it is valid onrow). Wrap the main content in arole="gridcell", and place each interactive control (theactionsslot and the deleteui5-button) in its ownrole="gridcell".SearchItemShowMoreTemplate.tsx: becomes arole="row"whose button sits in arole="gridcell".- Keyboard: extend the existing roving-tabindex handling so Up/Down move between rows and Left/Right (or Tab within a row, per the grid pattern) move focus to the interactive cells within the focused row.
Recommendation
- Use Option 1 (
listitem) if selection is visual/active-item only — it is the smallest, lowest-risk change and makes the interactive children valid immediately. - Use Option 2 (
grid) if the selected state must stay exposed to assistive technologies, since it keepsaria-selectedwhile still permitting the embedded controls.
References: WAI-ARIA APG — Combobox pattern (note on popups containing interactive elements), Listbox pattern, and Grid pattern; and the WAI-ARIA spec for aria-selected supported roles.
Priority
Medium (Accessibility issue)
Environment Info
- UI5 Web Components Version: 2.29.0 (also present on
main/ latest) - Browser: Browser-agnostic (semantic/ARIA issue in the rendered DOM; verified in Chrome / Edge)
- Operating System: Windows 11
Additional Context
This is a semantic accessibility (WAI-ARIA conformance) issue rather than a visual/functional regression. It affects the correctness of the exposed accessibility tree for search suggestions that include a delete action or custom actions.
Declaration
- [x] I'm not disclosing any internal or sensitive information.
Hello @UI5/ui5-team-ctr-ril ,
Please check the reported issue as it seems to be legit.
Best Regards, Nikolay Hristov
Hello @mastanshaikk,
Thank you for raising this and for the detailed analysis!
We've reviewed the issue internally and discussed it with our responsible designer and the central accessibility team. The feedback confirms that the concern you raised is valid and relevant from an accessibility perspective. However, the current behavior is in line with our existing specification — so a fix cannot be shipped as a simple bug correction. Any change here would be an update to the accessibility specification of the Search component, which requires the following steps first:
- Specification update on the design side — including analysis, discussion, and accessibility testing led by the central ACC team
- Implementation on our side — only after the updated specification is finalized.
This means we are not able to address this as a GitHub issue fix. We will instead track it as a Backlog Item (BLI) in our internal planning, so it goes through the proper design and review process before implementation begins. Thank you for your patience — we know this is not the quick turnaround you may have hoped for, but we want to make sure the solution is well-defined and doesn't introduce regressions in other areas.
Kind Regards, Niya