Skip to content

Commit cf8580e

Browse files
authored
Merge pull request #139 from huanshankeji/copilot/fix-lazycolumn-lazyrow-text-issue
Fix text clipping in JS DOM: remove unnecessary `overflow: hidden` from default `TextOverflow.Clip`
2 parents e144faf + 5c1d70f commit cf8580e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

common/src/jsMain/kotlin/com/huanshankeji/compose/ui/text/style/TextOverflow.js.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ fun StyleScope.applyStyle(textOverflow: TextOverflow, softWrap: Boolean, maxLine
5050

5151
when (textOverflow) {
5252
TextOverflow.Clip -> {
53-
overflow(Overflow.Hidden)
54-
textOverflow(CssTextOverflow.Clip)
53+
// Don't apply `overflow: hidden` here.
54+
// `text-overflow: clip` is the CSS default, and `overflow: hidden` on a blockified span
55+
// (in a flex container with `gap`) causes the height to collapse, clipping the text.
56+
// When `maxLines` is constrained, the `-webkit-line-clamp` block below already applies `overflow: hidden`.
5557
}
5658

5759
TextOverflow.Ellipsis -> {

0 commit comments

Comments
 (0)