You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(clamp): measure real line height so -webkit-line-clamp works without line-height
usedLineHeightPx guessed the line box as font-size*1.2 (or the raw CSS value).
But `line-height: normal` is font-metric dependent, and inside a -webkit-box the
line box never shrinks below the font strut, so e.g. line-height:18px on 20px
text still lays out at ~20px. The guessed targetH under-counted the lines and the
clamp truncated to too few lines (or dropped the ellipsis entirely).
Measure the real per-line height from the live element (scrollHeight of a single
line) instead of guessing.
Fixes#443
0 commit comments