-
Notifications
You must be signed in to change notification settings - Fork 144
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
Dynamic text can shrink, but font-size doesn't seem to increase when text changes #40
Comments
This should absolutely happen using our code that listens to Lines 70 to 74 in 11e5c15
The workaround with I don’t have the ability to debug this problem, but if you figure out why that code does not trigger a resize, a PR is very welcome. |
Hello, thanks for your help! I could see that I looked at the code and found my problem here: Lines 92 to 96 in 11e5c15
The & > div {
width: 100%;
height: 100%;
} This sets width and height to 100% for the (In my case, I'm showing text inside a box with fixed width and height values.) Thanks again! |
Thanks for this. Was pulling my hair out with the shrinking text =) |
Maybe related to #38
I have a div with some dynamic text that the user enters. When the text is too long,
react-textfit
does a good job of shrinking it to fit. But if the text becomes shorter, it does not increase the size again. Is this the expected behavior?My workaround is set a key, like
<Textfit key={text}>
. This means that React will use a newTextfit
component whenever the text changes, so it always recalculates the correct size.But it might be good if
react-textfit
had an option for this, even if it is not the default behavior.The text was updated successfully, but these errors were encountered: