diff --git a/packages/main/cypress/specs/RatingIndicator.cy.ts b/packages/main/cypress/specs/RatingIndicator.cy.ts index d11fa3f314fb..1b8fcf77ea4a 100644 --- a/packages/main/cypress/specs/RatingIndicator.cy.ts +++ b/packages/main/cypress/specs/RatingIndicator.cy.ts @@ -63,4 +63,29 @@ describe("RatingIndicator", () => { .should("have.css", "height", "24px"); }); }); + + describe("RatingIndicator Accessibility", () => { + it("should be able to tab after and before readonly element", () => { + cy.mount(html` + + + + `); + + cy.get("button:first").realClick(); + cy.focused().should("contain", "Before"); + + // press tab + cy.realPress("Tab"); + cy.realPress("Tab"); + + cy.focused().should("contain", "after"); + + // press shift + tab + cy.realPress(["Shift", "Tab"]); + cy.realPress(["Shift", "Tab"]); + + cy.focused().should("contain", "Before"); + }); + }); }); diff --git a/packages/main/src/RatingIndicator.ts b/packages/main/src/RatingIndicator.ts index f53a2b36b067..585d1eb771c8 100644 --- a/packages/main/src/RatingIndicator.ts +++ b/packages/main/src/RatingIndicator.ts @@ -251,7 +251,6 @@ class RatingIndicator extends UI5Element { _onkeydown(e: KeyboardEvent) { if (this.disabled || this.readonly) { - e.preventDefault(); return; }