dotdotdot-js
dotdotdot-js copied to clipboard
fix height calculation in fits function for inline elements
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!