react-textfit icon indicating copy to clipboard operation
react-textfit copied to clipboard

Multi mode does not appear to work

Open kojow7 opened this issue 5 years ago • 3 comments

When I use single mode, the text fits perfectly in a single line. However, when I change the mode to "multi", it no longer seems to resize the text.

Below is an example of my code:


    return(
        <div style={{fontSize: '15px'}}>
            <div style={{margin: '10px', fontFamily: 'Times New Roman', border: 'solid black 2px', width: '200px', height: '80px'}}>
                <Textfit mode="multi">
                    The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.
                </Textfit>
            </div>
        </div>
    )

A screenshot of what I am seeing:

image

Is this a problem with the module, or am I doing something wrong?

kojow7 avatar May 25 '19 15:05 kojow7

I'm also having the same exact issue

ijaazt avatar Jul 06 '19 22:07 ijaazt

Try putting the height style directly on the Textfit component. That has worked for me.

jathom30 avatar Sep 20 '19 13:09 jathom30

<TextFit style={{maxHeight: ...}} /> worked for me!

rmfarrell avatar Nov 12 '20 23:11 rmfarrell