Skip to content

fix(ui5-text): unify truncation across all max-lines values#13624

Merged
nnaydenow merged 6 commits into
mainfrom
text-truncation
Jun 4, 2026
Merged

fix(ui5-text): unify truncation across all max-lines values#13624
nnaydenow merged 6 commits into
mainfrom
text-truncation

Conversation

@nnaydenow
Copy link
Copy Markdown
Contributor

@nnaydenow nnaydenow commented Jun 2, 2026

Previously, single-line truncation (max-lines="1") used a separate CSS. All other values relied on -webkit-line-clamp via a :not([max-lines="1"]) selector.

This split caused inconsistent behavior and required two code paths for what is semantically the same feature. Since -webkit-line-clamp: 1 produces equivalent truncation to the inline-block approach, both cases are now handled by the single -webkit-line-clamp path.

Infinity as the CSS variable value maps to none on -webkit-line-clamp (browsers treat an unrecognised/non-integer value as unset), so the default "no truncation" behaviour is preserved without an explicit reset rule.

The core reasoning: max-lines="1" no longer needs its own display/whitespace block — -webkit-line-clamp: 1 does the same job, and Infinity as a CSS value is treated as none/unset by the browser, so no truncation applies at the default.

In this change #13566 is reverted as well.

Fixes: #10721

@nnaydenow nnaydenow requested review from dimovpetar and ilhan007 and removed request for dimovpetar June 2, 2026 10:42
@nnaydenow nnaydenow temporarily deployed to netlify-preview June 2, 2026 10:42 — with GitHub Actions Inactive
@nnaydenow nnaydenow requested a review from dimovpetar June 2, 2026 10:42
@ui5-webcomponents-bot
Copy link
Copy Markdown
Collaborator

ui5-webcomponents-bot commented Jun 2, 2026

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

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview June 2, 2026 10:49 Inactive
@nnaydenow nnaydenow temporarily deployed to netlify-preview June 2, 2026 12:03 — with GitHub Actions Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview June 2, 2026 12:10 Inactive
@nnaydenow nnaydenow temporarily deployed to netlify-preview June 3, 2026 11:53 — with GitHub Actions Inactive
@nnaydenow nnaydenow temporarily deployed to netlify-preview June 3, 2026 11:59 — with GitHub Actions Inactive
Copy link
Copy Markdown
Member

@dimovpetar dimovpetar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text changes look good

@nnaydenow nnaydenow temporarily deployed to netlify-preview June 4, 2026 07:59 — with GitHub Actions Inactive
@nnaydenow nnaydenow temporarily deployed to netlify-preview June 4, 2026 08:14 — with GitHub Actions Inactive
@nnaydenow nnaydenow merged commit 3c50320 into main Jun 4, 2026
19 of 20 checks passed
@nnaydenow nnaydenow deleted the text-truncation branch June 4, 2026 08:30
@nnaydenow nnaydenow temporarily deployed to netlify-preview June 4, 2026 08:31 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Text]: Word Break instead of Ellipsis for Single Line Text

3 participants