Skip to content

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

Open
nnaydenow wants to merge 2 commits into
mainfrom
text-truncation
Open

fix(ui5-text): unify truncation across all max-lines values#13624
nnaydenow wants to merge 2 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

@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
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

2 participants