Skip to content

fix(ui5-shellbar): prevent double announcement of notifications count - #14134

Open
IlianaB wants to merge 1 commit into
mainfrom
fix/ui5-shellbar-notifications-double-announcement
Open

IlianaB wants to merge 1 commit into
mainfrom
fix/ui5-shellbar-notifications-double-announcement

Conversation

@IlianaB

@IlianaB IlianaB commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Problem
When notificationsCount is set on ui5-shellbar, JAWS announces the notification count twice in quick succession:

aria-label="X items" — derived automatically by ui5-button from the count badge text
title="X Notifications" — the ShellBar tooltip passed via the tooltip prop

Root cause
This is a regression from two PRs whose interaction was not anticipated:

#11396 fix(ui5-button): announce accessible name introduced logic in Button.ariaLabelText that automatically appends a badge count as "X items" to the button's aria-label whenever a is present.

#11284 feat(ui5-shellbar): replace custom badges with ButtonBadge migrated the notifications count from a CSS data-* attribute to a real . This inadvertently activated the #11396 badge-to-aria-label logic on the bell button — which already had its own tooltip providing the accessible name.

Before #11284, no badge slot was filled, so the "X items" logic never ran. After it, the button produces both strings simultaneously.

Fix
In ShellBarAccessibility.ts, the notifications entry now passes an explicit ariaLabel (equal to the existing tooltip text, e.g. "5 Notifications") via accessibilityAttributes.

In Button._computedAccessibilityAttributes, an explicit ariaLabel short-circuits the fallback to ariaLabelText, so the generic badge description is never used as the accessible name. The result is a single, coherent announcement: "5 Notifications".

The visual badge, hover tooltip, and all other accessibilityAttributes (expanded, hasPopup) are unaffected.

The notifications button received both an aria-label of "X items" (from
the Button's generic badge description logic) and a title of "X Notifications"
(from the ShellBar tooltip), causing JAWS to announce both strings.

This was a regression introduced in feat(ui5-shellbar): replace custom
badges with ButtonBadge (#11284), which moved the count from a data-*
attribute to a real <ButtonBadge slot="badge">. That activated the
Button's badge-to-aria-label logic added in fix(ui5-button): announce
accessible name (#11396), which was never intended to run for the bell button.

Fix: pass an explicit ariaLabel on the notifications accessibilityAttributes
so Button uses it directly instead of deriving a label from the badge text.
@IlianaB
IlianaB deployed to netlify-preview October 9, 2026 10:01 — with GitHub Actions Active
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

This branch was successfully deployed

1 active deployment
netlify-preview — db41b0b7 Deployed Oct 9, 2026 by IlianaB via deploy-preview #3470
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.

1 participant