Skip to content

Commit fd12ada

Browse files
authored
fix(ui5-shellbar): improve accessibility for shellbar item count announcement (SAP#11201)
Added accessible name that announces item title and text with count from data-count. Fixes: SAP#11198
1 parent dc41941 commit fd12ada

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/fiori/src/ShellBar.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ interface IShelBarItemInfo extends IShellBarHidableItem {
132132
profile?: boolean,
133133
tooltip?: string,
134134
accessibilityAttributes?: ShellBarItemAccessibilityAttributes,
135+
accessibleName?: string,
135136
}
136137

137138
interface IShellBarContentItem extends IShellBarHidableItem {
@@ -1063,6 +1064,7 @@ class ShellBar extends UI5Element {
10631064
stableDomRef: item.stableDomRef,
10641065
tooltip: item.title || item.text,
10651066
accessibilityAttributes: item.accessibilityAttributes,
1067+
accessibleName: item.count ? `${item.title || item.text}, ${item.count}` : (item.title || item.text),
10661068
};
10671069
}),
10681070
{

packages/fiori/src/ShellBarTemplate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ export default function ShellBarTemplate(this: ShellBar) {
197197
data-ui5-stable={item.stableDomRef}
198198
onClick={item.press}
199199
accessibilityAttributes={item.accessibilityAttributes}
200+
accessibleName={item.accessibleName}
200201
/>
201202
))}
202203
</div>

0 commit comments

Comments
 (0)