diff --git a/packages/main/cypress/specs/List.cy.tsx b/packages/main/cypress/specs/List.cy.tsx index 2afa8145fc19..42a3372fbc8d 100644 --- a/packages/main/cypress/specs/List.cy.tsx +++ b/packages/main/cypress/specs/List.cy.tsx @@ -598,6 +598,27 @@ describe("List - Accessibility", () => { }); }); + it("does not announce F2 instruction for custom list items without tabbable content", () => { + cy.mount( + + Pineapple + Papaya + + ); + + cy.get("[ui5-list]") + .shadow() + .find(".ui5-list-ul") + .invoke("attr", "aria-description") + .then((ariaDesc) => { + cy.get("[ui5-list]") + .should(($list) => { + const defaultText = $list.prop("defaultAriaDescriptionText") as string; + expect(ariaDesc ?? "").to.not.include(defaultText); + }); + }); + }); + it("announces 'Selected' when an item is selected in Single mode via mouse click", () => { cy.mount( diff --git a/packages/main/src/List.ts b/packages/main/src/List.ts index 8dd1180aece4..db0570d2c79d 100644 --- a/packages/main/src/List.ts +++ b/packages/main/src/List.ts @@ -780,7 +780,13 @@ class List extends UI5Element { } return this.getItems().some(item => { - return item.getAttribute("type") === "Detail" || isInstanceOfListItemCustom(item); + if (item.getAttribute("type") === "Detail") { + return true; + } + if (isInstanceOfListItemCustom(item)) { + return item._hasFocusableElements(); + } + return false; }); }