malte-wessel / react-textfit

React component to fit headlines and paragraphs into elements
http://malte-wessel.github.io/react-textfit/
MIT License
470 stars 143 forks source link

Consider height of the container as well #29

Closed MarcMagnin closed 7 years ago

MarcMagnin commented 7 years ago

Again thanks a lot for that library, it works like a charm. But again I'm coming with more question, is it possible to consider the height of the container as well?

I have a component that is fully resizable and that can end up in such situation: image

Many thanks!

denis-sokolov commented 7 years ago

I’m pretty sure we’re supposed to handle the height of the container as well. It’s either a weird setup you have or a bug in our library. Please try to isolate your behavior and show a demo of the breakage on a website like jsbin.com, then reopen the issue for us to investigate.

MarcMagnin commented 7 years ago

Cheers, tricky to setup a jsbin but I'll do later if I find the time. Definitly it doesn't consider the height even if I set the height as static such as 40px. I've tried as well to modify the css on the demo page you provide: image

But maybe that's related to the library resize function not getting called.