[Menu]: a11y: ui5-menu popover exposes role="dialog" (aria-modal) instead of role="menu", inconsistent with an aria-haspopup="menu" opener

Aperta
#14,219 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@unazko ci sta già lavorando.

Dal 29/10/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Read packages/main/src/Popup.ts and MenuTemplate.tsx to trace the popover role default and how ui5-menu configures its ResponsivePopover. Check the related items #9313, #6810, and #6090 for context, then inspect the open menu’s accessibility tree. Done when the popup exposes the menu semantics without a competing dialog role or aria-modal wrapper.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug Medium Prio TOPIC B
Describe the bug

When a trigger button declares aria-haspopup="menu" and opens a ui5-menu, the opened popup is not exposed as a menu. ui5-menu renders its items in a ResponsivePopover whose inner section is role="dialog" with aria-modal="true", wrapping the role="menu" list. A screen reader therefore announces a "menu button" on the opener but encounters a dialog containing the menu — an inconsistent popup semantic (WCAG 4.1.2 Name, Role, Value; 1.3.1).

A consumer cannot fix this from outside the component: the ResponsivePopover lives in ui5-menu's shadow DOM, ui5-menu exposes no prop to change the popover role, and the PopupAccessibleRole enum only offers None | Dialog | AlertDialog (no Menu).

Root cause (source)
  • Popup.accessibleRole defaults to "Dialog" — packages/main/src/Popup.ts:178 — which drives the section role="dialog" (_role) and aria-modal="true" (_ariaModal).
  • MenuTemplate.tsx wraps List accessibleRole="Menu" in a ResponsivePopover without setting accessibleRole, so the menu's popover inherits the "Dialog" default.
Isolated example

Any Button with aria-haspopup="menu" as the opener of a ui5-menu with a couple of ui5-menu-items. Inspect the accessibility tree with the menu open.

Expected behaviour

The opened popup's role matches the opener's aria-haspopup="menu" — i.e. the only popup role exposed is the List's role="menu" with its role="menuitem" children; no competing role="dialog" / aria-modal wrapper.

Actual behaviour

Accessibility tree (desktop):

dialog "Select an option from the menu"  (aria-modal="true")   <-- ResponsivePopover section
  menu
    menuitem "..."
    menuitem "..."
Suggested fix

Have ui5-menu set its internal ResponsivePopover accessibleRole="None" (which makes _role and _ariaModal undefined) so the List's role="menu" is the sole exposed popup semantic. Popover focus management is handled by the focus-trap spans, so keyboard behaviour is unaffected.

Context

Found while verifying an SAP SuccessFactors accessibility defect: Approve/Decline "menu buttons" on the Home page open ui5-menu; aria-expanded toggles and role="menu"/role="menuitem" are present, but the popover wrapper is role="dialog". Related prior items: #9313 (Menu popover treated as a dialog, accessible name added), #6810 / #6090 (requests to allow a menu role on Popover).

UI5 Web Components version

2.x (reproduced on current main)

Lingua principale
TypeScript
Stelle
1.8k
Fork
289
Merge medio
4g 5h
PR unite (30g)
33

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di UI5/webcomponents

Tutte le issue di UI5/webcomponents

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.