-
Notifications
You must be signed in to change notification settings - Fork 121
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
Table updates do not work #20
Comments
I am unable to replicate this. TextFit is working fine with Arrays or NodeLists. Please reopen if you have failing code or are still experiencing this issue. |
What textFit does not work fine with, however, is HTMLCollection objects. And in Firefox 46 and Chrome 50, getElementsByClassName() returns a HTMLCollection object. See https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName. Here's a simplified testcase illustrating document.getElementsByClassName() not working. Try it in the latest version of Firefox or Chrome. The first two divs get their text expanded, and the last two do not.
I fixed this by changing the line
Thank you. |
Thanks - could you make a PR for this? |
Fixed in |
Hello,
Thanks for this nice tool! :-)
One issue still I have:
If I do a textFit for an array : textFit(document.getElementsByClassName('box'));
It does not work.
But if I do a textFit to an element only it works:
textFit(document.getElementsByClassName('box')[0]);
Would you have any idea why?
I am using Chrome. Here is my code:
(I have text being filled into DIvs depending on IDs too..)
Then
textFit(document.getElementsByClassName('responsive_levelbackground'));
does not work
but textFit(document.getElementsByClassName('responsive_levelbackground')[0]);
textFit(document.getElementsByClassName('responsive_levelbackground')[1]);
...
work fine..
Thank you
The text was updated successfully, but these errors were encountered: