STRML / textFit

A jQuery-free component that quickly fits single and multi-line text to the width (and optionally height) of its container.
https://textfit.strml.net
637 stars 123 forks source link

Do not throw error when width or height is zero #52

Open hypnoce opened 3 years ago

hypnoce commented 3 years ago

In case the innerWidth or height of an element is zero, the lib throws an error : https://github.com/STRML/textFit/blob/7a1eed6db54a97798556eed3c57b2ce1f87dbab4/textFit.js#L104 I think we can add an option to gracefully fail and ignore those edge cases. WDYT ?