Skip to content

Commit 6a6b6e8

Browse files
authored
chore(ui5-side-navigation): update overflow item accessible text (#11481)
- add 'aria-description' - update role form 'menuitem' to 'menuitemradio' JIRA: BGSOFUIRODOPI-3230
1 parent 93066c6 commit 6a6b6e8

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

packages/fiori/cypress/specs/SideNavigation.cy.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,16 @@ describe("Side Navigation Accessibility", () => {
11721172
.shadow()
11731173
.find(".ui5-sn-flexible")
11741174
.should("have.attr", "aria-roledescription", "Navigation List Menu Bar");
1175+
1176+
cy.get("#sideNav")
1177+
.invoke("attr", "style", "height: 100px");
1178+
1179+
cy.get("#sideNav")
1180+
.shadow()
1181+
.find("[ui5-side-navigation-item][is-overflow]")
1182+
.shadow()
1183+
.find(".ui5-sn-item")
1184+
.should("have.attr", "aria-label", "Displays remaining navigation items");
11751185
});
11761186

11771187
it("SideNavigationItem aria-checked in collapsed SideNavigation", () => {

packages/fiori/src/SideNavigationItem.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import type SideNavigationSubItem from "./SideNavigationSubItem.js";
1818
import {
1919
SIDE_NAVIGATION_ICON_COLLAPSE,
2020
SIDE_NAVIGATION_ICON_EXPAND,
21+
SIDE_NAVIGATION_OVERFLOW_ITEM_LABEL,
2122
} from "./generated/i18n/i18n-defaults.js";
2223

2324
// Templates
@@ -188,6 +189,14 @@ class SideNavigationItem extends SideNavigationSelectableItemBase {
188189
: SideNavigationItem.i18nBundle.getText(SIDE_NAVIGATION_ICON_EXPAND);
189190
}
190191

192+
get _ariaLabel() {
193+
if (this.isOverflow) {
194+
return SideNavigationItem.i18nBundle.getText(SIDE_NAVIGATION_OVERFLOW_ITEM_LABEL);
195+
}
196+
197+
return undefined;
198+
}
199+
191200
applyInitialFocusInPopover() {
192201
if (this.unselectable && this.items.length) {
193202
this.items[0]?.focus();

packages/fiori/src/SideNavigationItemTemplate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ function MenuItemTemplate(this: SideNavigationItem) {
6161
aria-haspopup={this._ariaHasPopup}
6262
aria-checked={this._ariaChecked}
6363
title={this._tooltip}
64+
aria-label={this._ariaLabel}
6465
>
6566
<Icon class="ui5-sn-item-icon" name={this.icon}/>
6667
<div class="ui5-sn-item-text">{this.text}</div>

packages/fiori/src/i18n/messagebundle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ SIDE_NAVIGATION_LIST_ITEMS_ARIA_ROLE_DESC=Navigation List Tree Item
498498
#XTXT: Accessible name for the Side Navigation overflow item
499499
SIDE_NAVIGATION_OVERFLOW_ACCESSIBLE_NAME=More Items
500500

501+
#XTXT: Aria description for the Side Navigation overflow item
502+
SIDE_NAVIGATION_OVERFLOW_ITEM_LABEL=Displays remaining navigation items
503+
501504
#XTXT: Text for the Side Navigation Primary list
502505
SIDE_NAVIGATION_FLEXIBLE_LIST_LABEL=Primary Navigation Menu
503506

0 commit comments

Comments
 (0)