From a3c2cf94cd0bbc47e660f14fbd27a6eb0e32f7a1 Mon Sep 17 00:00:00 2001 From: Teodor Taushanov Date: Thu, 30 Oct 2025 13:57:59 +0200 Subject: [PATCH 1/2] fix(ui5-carousel): add correct aria-label to the list element --- packages/main/cypress/specs/Carousel.cy.tsx | 5 +++++ packages/main/src/Carousel.ts | 5 +++++ packages/main/src/CarouselTemplate.tsx | 2 +- packages/main/src/i18n/messagebundle.properties | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/main/cypress/specs/Carousel.cy.tsx b/packages/main/cypress/specs/Carousel.cy.tsx index 5d421ca6e05f..9e871a96435e 100644 --- a/packages/main/cypress/specs/Carousel.cy.tsx +++ b/packages/main/cypress/specs/Carousel.cy.tsx @@ -252,6 +252,11 @@ describe("Carousel general interaction", () => { .find(".ui5-carousel-content") .should("have.attr", "role", "list"); + cy.get("#carousel5") + .shadow() + .find(".ui5-carousel-content") + .should("have.attr", "aria-label", "Item Container"); + cy.get("#carousel5") .shadow() .find(".ui5-carousel-item") diff --git a/packages/main/src/Carousel.ts b/packages/main/src/Carousel.ts index b800a2ec99bd..cc369f7f78e5 100644 --- a/packages/main/src/Carousel.ts +++ b/packages/main/src/Carousel.ts @@ -33,6 +33,7 @@ import { CAROUSEL_PREVIOUS_ARROW_TEXT, CAROUSEL_NEXT_ARROW_TEXT, CAROUSEL_ARIA_ROLE_DESCRIPTION, + CAROUSEL_ARIA_LIST_LABEL, } from "./generated/i18n/i18n-defaults.js"; import CarouselArrowsPlacement from "./types/CarouselArrowsPlacement.js"; import CarouselPageIndicatorType from "./types/CarouselPageIndicatorType.js"; @@ -977,6 +978,10 @@ class Carousel extends UI5Element { return Carousel.i18nBundle.getText(CAROUSEL_ARIA_ROLE_DESCRIPTION); } + get _ariaListLabel() { + return Carousel.i18nBundle.getText(CAROUSEL_ARIA_LIST_LABEL); + } + /** * Returns only visible (non-hidden) content items. * Items with the 'hidden' attribute are automatically excluded from carousel navigation. diff --git a/packages/main/src/CarouselTemplate.tsx b/packages/main/src/CarouselTemplate.tsx index c518f2d6e8f1..5ae041996380 100644 --- a/packages/main/src/CarouselTemplate.tsx +++ b/packages/main/src/CarouselTemplate.tsx @@ -21,7 +21,7 @@ export default function CarouselTemplate(this: Carousel) { onMouseDown={this._onmousedown} >
-
+
{this.items.map(itemInfo =>
Date: Mon, 3 Nov 2025 10:39:09 +0200 Subject: [PATCH 2/2] chore: adress code comments --- packages/main/src/i18n/messagebundle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/main/src/i18n/messagebundle.properties b/packages/main/src/i18n/messagebundle.properties index 2e602e9e0db7..4ec85cc590c2 100644 --- a/packages/main/src/i18n/messagebundle.properties +++ b/packages/main/src/i18n/messagebundle.properties @@ -115,7 +115,7 @@ CAROUSEL_NEXT_ARROW_TEXT=Next Page #XACT: ARIA announcement for the attribute 'aria-roledescription' of the Carousel component CAROUSEL_ARIA_ROLE_DESCRIPTION=Carousel -#XACT: ARIA announcement for aria label attribute of Carousel element with list role +#XACT: ARIA announcement for the aria-label attribute of an element within a Carousel component with a list role CAROUSEL_ARIA_LIST_LABEL=Item Container #XFLD: Label of the container holding the colors