From a16e978253b450d068e7bc6b9f3dec1bbc74108c Mon Sep 17 00:00:00 2001 From: tsanislavgatev Date: Thu, 8 Jan 2026 11:30:38 +0200 Subject: [PATCH 1/4] fix(ui5-link): remove length check from tabindex calculation --- packages/main/src/Link.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/main/src/Link.ts b/packages/main/src/Link.ts index de62c5cfccb8..c65c0b4b5b3e 100644 --- a/packages/main/src/Link.ts +++ b/packages/main/src/Link.ts @@ -321,7 +321,7 @@ class Link extends UI5Element implements ITabbable { return Number.parseInt(this.forcedTabIndex); } - return (this.disabled || !this.textContent?.length) ? -1 : 0; + return this.disabled ? -1 : 0; } get ariaLabelText() { From 86c804fe630a46132f9b196bc4e59eb020cb2ca5 Mon Sep 17 00:00:00 2001 From: tsanislavgatev Date: Thu, 8 Jan 2026 11:38:17 +0200 Subject: [PATCH 2/4] fix(ui5-link): remove slot and fix tests --- packages/main/cypress/specs/Link.cy.tsx | 61 ------------------------- packages/main/src/Link.ts | 9 ---- 2 files changed, 70 deletions(-) diff --git a/packages/main/cypress/specs/Link.cy.tsx b/packages/main/cypress/specs/Link.cy.tsx index 307366683e29..cc4812e79673 100644 --- a/packages/main/cypress/specs/Link.cy.tsx +++ b/packages/main/cypress/specs/Link.cy.tsx @@ -260,65 +260,4 @@ describe("General API", () => { cy.get("@signInDialog") .should("be.visible"); }); - - it("tabindex should update when text content is added after mount", () => { - // Mount link without text content - cy.mount(); - - // Initially, tabindex should be -1 because there's no text content - cy.get("#dynamic-link") - .shadow() - .find(".ui5-link-root") - .should("have.attr", "tabindex", "-1"); - - // Add text content dynamically - cy.get("#dynamic-link") - .then($link => { - $link[0].textContent = "Click me"; - }); - - // After text is added, tabindex should become 0 - cy.get("#dynamic-link") - .shadow() - .find(".ui5-link-root") - .should("have.attr", "tabindex", "0"); - }); - - it("tabindex should remain 0 when text content changes", () => { - cy.mount(Initial Text); - - cy.get("#text-change-link") - .shadow() - .find(".ui5-link-root") - .should("have.attr", "tabindex", "0"); - - cy.get("#text-change-link") - .then($link => { - $link[0].textContent = "Updated Text"; - }); - - cy.get("#text-change-link") - .shadow() - .find(".ui5-link-root") - .should("have.attr", "tabindex", "0"); - }); - - it("tabindex should be -1 when text content is removed", () => { - cy.mount(Some text); - - cy.get("#remove-text-link") - .shadow() - .find(".ui5-link-root") - .should("have.attr", "tabindex", "0"); - - cy.get("#remove-text-link") - .then($link => { - $link[0].textContent = ""; - }); - - cy.get("#remove-text-link") - .shadow() - .find(".ui5-link-root") - .should("have.attr", "tabindex", "-1"); - }); }); diff --git a/packages/main/src/Link.ts b/packages/main/src/Link.ts index c65c0b4b5b3e..1746e790328d 100644 --- a/packages/main/src/Link.ts +++ b/packages/main/src/Link.ts @@ -269,15 +269,6 @@ class Link extends UI5Element implements ITabbable { @property() endIcon?: string; - /** - * Defines the text of the component. - * - * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design. - * @public - */ - @slot({ type: Node, "default": true }) - text!: Array; - @property({ noAttribute: true }) _rel: string | undefined; From 86a98d4aeffec132c493273212e3ab84b34374ac Mon Sep 17 00:00:00 2001 From: tsanislavgatev Date: Thu, 8 Jan 2026 11:39:06 +0200 Subject: [PATCH 3/4] fix(ui5-link): fix documentation and imports --- packages/main/src/Link.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/main/src/Link.ts b/packages/main/src/Link.ts index 1746e790328d..4ebbd03e4eeb 100644 --- a/packages/main/src/Link.ts +++ b/packages/main/src/Link.ts @@ -2,7 +2,6 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js"; import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js"; import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js"; import property from "@ui5/webcomponents-base/dist/decorators/property.js"; -import slot from "@ui5/webcomponents-base/dist/decorators/slot.js"; import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js"; import type { AccessibilityAttributes } from "@ui5/webcomponents-base/dist/types.js"; import { isSpace, isEnter } from "@ui5/webcomponents-base/dist/Keys.js"; @@ -71,7 +70,6 @@ type LinkAccessibilityAttributes = Pick} default - Defines the text of the component. * * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design. */ From 70cbe64efb4ac0a7c8832026afeef8655d7de044 Mon Sep 17 00:00:00 2001 From: tsanislavgatev Date: Thu, 8 Jan 2026 11:41:47 +0200 Subject: [PATCH 4/4] fix(ui5-link): fix documentation and imports --- packages/main/src/Link.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/main/src/Link.ts b/packages/main/src/Link.ts index 4ebbd03e4eeb..f59d9d220fbf 100644 --- a/packages/main/src/Link.ts +++ b/packages/main/src/Link.ts @@ -70,6 +70,7 @@ type LinkAccessibilityAttributes = Pick} default - Defines the text of the component. * * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design. */