Skip to content

Conversation

danielloeh
Copy link

If we used firefox (or any other browser without native clamping), the last line was always clamped: it cuts of the last letter and appends e.g. the "..." even if theres plenty of space in that line. This is because the condition checks if the current line height is greater or equal than the maximum allowed. So if the text is rendered in two lines (eg 2 x 10px) and the maximum allowed is the same, it still gets clamped. We removed the "or equal" from the condition so it only gets truncated if the rendered line height is too high and that works for us perfectly now.

@ghost
Copy link

ghost commented May 17, 2015

+1 this is a working fix

@laustdeleuran
Copy link

This probably fixes issue #33

@ghost
Copy link

ghost commented May 28, 2015

It doesn't look like this library is being maintained so here you go

@laustdeleuran
Copy link

@timrnz Thanks! I actually ended op writing my own version.

@ghost
Copy link

ghost commented Jun 4, 2015

@laustdeleuran awesome! I've been meaning to re-write it into ES6/'15. Maybe I'll do it this weekend.

@laustdeleuran
Copy link

@timrnz awesome - keep me posted on that. Still need to get into the ES6 game myself.

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.

2 participants