dotdotdot-js icon indicating copy to clipboard operation
dotdotdot-js copied to clipboard

fix height calculation in fits function for inline elements

Open totaltrece opened this issue 4 years ago • 0 comments

Hi, this pull request solves a problem encountered when applying dotdotdot on line elements in the fits function. It always returned zero as the height of the element so it always returned true and did not truncate it. The solution has been to take the maximum of the different types of element height as does the jquery innerHeight function used in the previous version:

https://github.com/jquery/jquery/blob/main/src/dimensions.js

I have also fixed two typing that made the code not compile.

Thanks for this very useful code!

totaltrece avatar Dec 02 '21 07:12 totaltrece