From a7f9a2df5ef908c8e63f4873b5fc3c5f7ea2cd91 Mon Sep 17 00:00:00 2001 From: Zoe Snape Date: Fri, 11 Dec 2015 12:43:17 -0500 Subject: [PATCH] Fix initial height check The initial height check truncated text if the original height was greater than or equal to the max allowable height, where it should only truncate if the original height is strictly greater than the max allowable height. This change makes the initial check consistent with the exit condition check, which checks if the current height is less than or equal to the max allowable height. --- clamp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clamp.js b/clamp.js index f13e8ad..13f3d2d 100644 --- a/clamp.js +++ b/clamp.js @@ -246,7 +246,7 @@ } else { var height = getMaxHeight(clampValue); - if (height <= element.clientHeight) { + if (height < element.clientHeight) { clampedText = truncate(getLastChild(element), height); } } @@ -258,4 +258,4 @@ } window.$clamp = clamp; -})(); \ No newline at end of file +})();