Skip to content

Commit 4a31804

Browse files
authored
fix(ui5-carousel): update roles to match ACC specification (#11074)
JIRA: BGSOFUIRODOPI-3382 fixes #10198 fixes #8624 downport of #11032
1 parent d5c6beb commit 4a31804

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/main/src/Carousel.hbs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<section
22
class="ui5-carousel-root ui5-carousel-background-{{_backgroundDesign}}"
33
tabindex="0"
4-
role="listbox"
4+
role="list"
5+
aria-roledescription={{_roleDescription}}
56
aria-label="{{ariaLabelTxt}}"
67
aria-activedescendant="{{ariaActiveDescendant}}"
78
@focusin="{{_onfocusin}}"
@@ -15,7 +16,7 @@
1516
<div id="{{id}}"
1617
class="ui5-carousel-item {{classes}}"
1718
style="{{styles}}"
18-
role="option"
19+
role="listitem"
1920
aria-posinset="{{posinset}}"
2021
aria-setsize="{{setsize}}"
2122
part="item"

packages/main/src/Carousel.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
CAROUSEL_DOT_TEXT,
2929
CAROUSEL_PREVIOUS_ARROW_TEXT,
3030
CAROUSEL_NEXT_ARROW_TEXT,
31+
CAROUSEL_ARIA_ROLE_DESCRIPTION,
3132
} from "./generated/i18n/i18n-defaults.js";
3233
import CarouselArrowsPlacement from "./types/CarouselArrowsPlacement.js";
3334
import CarouselPageIndicatorStyle from "./types/CarouselPageIndicatorStyle.js";
@@ -696,6 +697,10 @@ class Carousel extends UI5Element {
696697
return getEffectiveAriaLabelText(this);
697698
}
698699

700+
get _roleDescription() {
701+
return Carousel.i18nBundle.getText(CAROUSEL_ARIA_ROLE_DESCRIPTION);
702+
}
703+
699704
get nextPageText() {
700705
return Carousel.i18nBundle.getText(CAROUSEL_NEXT_ARROW_TEXT);
701706
}

packages/main/src/i18n/messagebundle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ CAROUSEL_PREVIOUS_ARROW_TEXT=Previous Page
100100
# Carousel Next Page text
101101
CAROUSEL_NEXT_ARROW_TEXT=Next Page
102102

103+
#XACT: ARIA announcement for the attribute 'aria-roledescription' of the Carousel component
104+
CAROUSEL_ARIA_ROLE_DESCRIPTION=Carousel
105+
103106
#XFLD: Label of the container holding the colors
104107
COLORPALETTE_CONTAINER_LABEL=Color palette - Predefined colors
105108

0 commit comments

Comments
 (0)