Skip to content

Conversation

@hinzzx
Copy link
Contributor

@hinzzx hinzzx commented Dec 9, 2025

The problem was that the ui5-link component was missing a @slot decorator for its default text slot.

Without this decorator:

  • The component didnt invalidate when slot content changed
  • The effectiveTabIndex getter (which checks this.textContent?.length) wasn't re-evaluated after text was added
  • The initial tabindex of -1 (set during first render when there was no text) remained unchanged

So we add the @slot decorator to the default text slot, following the same pattern used in theui5-button component:

This ensures that:

  • When text content is added, removed, or changed in the slot, the component is invalidated
  • The component re-renders and recalculates effectiveTabIndex
  • The tabindex attribute in the shadow DOM is updated correctly

Before

2025-12-09_16-04-10 (1)

After

2025-12-09_16-00-11 (1)

Fixes: #5843

@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Dec 9, 2025

🧹 Preview deployment cleaned up: https://pr-12781--ui5-webcomponents.netlify.app

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview December 9, 2025 14:12 Inactive
@hinzzx hinzzx merged commit 6bc4f0a into main Dec 10, 2025
28 of 30 checks passed
@hinzzx hinzzx deleted the link-tab-index-fix branch December 10, 2025 08:22
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview December 10, 2025 08:22 Inactive
@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.18.0-rc.0 🎉

The release is available on v2.18.0-rc.0

Your semantic-release bot 📦🚀

@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.18.0 🎉

The release is available on v2.18.0

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui5-link: Problem with tabindex="-1" when using with Svelte (or similar)

4 participants