Clamp.js
Clamp.js copied to clipboard
"Unreasonable" truncation in some cases
Consider the following screenshot:
https://www.dropbox.com/s/2y1vnoaq2p7i0m9/_Screenshot%202014-06-03%2014.48.57.png
The third word (partly elliptisized in the second text line on the screenshot) is "ID". The ellipsis is clearly unnecessary here.
The following little change seems to solve the problem: https://github.com/pdkovacs/Clamp.js/commit/2756c06c3b52e1c403116a8168d9d99f40d95b8c . This solution is, however, completely based on "informal reasoning", that is, without me really understanding the details of the implementation. (I just told to myself as I was debugging the issue: "Hey, why do we need to do anything if the clientHeight equals the required height?")
Any comments? Any advices on what I may be missing in terms of configuration, usage scenario, etc?
+1 having the same issue and the linked fix seems to solve the issue for me. Haven't done a whole of testing it yet
+1 I was having a similar issue: text being truncated even if there was plenty of room. It replicates in this plunkr, only in Firefox (non-native clamping): https://plnkr.co/edit/CHd0uFyfEPpuEGRqzbaH?p=preview The fix from @pdkovacs solved my issue, too. Thanks!