Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on "hidden" elements #45

Open
MarcusU opened this issue Feb 2, 2021 · 3 comments
Open

Doesn't work on "hidden" elements #45

MarcusU opened this issue Feb 2, 2021 · 3 comments

Comments

@MarcusU
Copy link

MarcusU commented Feb 2, 2021

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 the textFit(myElement) before setting hidden to false, then it defaults to the smallest text size.
Is there a way to make this work on hidden elements?

@MarcusU
Copy link
Author

MarcusU commented Feb 2, 2021

Perhaps a way to pass in the height and width of the element instead of deriving it? I know the height and width beforehand

@MarcusU
Copy link
Author

MarcusU commented Feb 2, 2021

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.

@sarahg
Copy link

sarahg commented Feb 14, 2021

@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. :)

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

No branches or pull requests

2 participants