Open MarcusU opened 3 years ago
Perhaps a way to pass in the height and width of the element instead of deriving it? I know the height and width beforehand
I've managed to get a working version of this. Maybe not the best way to make it work, but it works for my purposes. I'll try to clean it up and create a PR in the next few days.
@MarcusU I just ran into this as well, doing something similar. Can you share how you got yours to work, even if it's not a PR yet? I have a (very bad) hack in place for now, but I would love to make it less of a landmine for my future self. :)
I have a couple divs that I show/hide using
element.hidden = true
etc. My code sets all the text, then unhides. If I run thetextFit(myElement)
before settinghidden
to false, then it defaults to the smallest text size.Is there a way to make this work on hidden elements?