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

Compatibility with flexbox #71

Open
iway1 opened this issue Jan 17, 2021 · 2 comments
Open

Compatibility with flexbox #71

iway1 opened this issue Jan 17, 2021 · 2 comments

Comments

@iway1
Copy link

iway1 commented Jan 17, 2021

This library just does not work with flex box containers:

export default function Comp() {
    return (
        <div style={{display: 'flex'}}><Textfit mode='single'>This will not resize.</Textfit></div>
    )
}

It would be nice if it worked correctly with flex box, or if the repo at least warned that it does not work with flex box.

I can try to make it work with flex box and submit a pull request if someone can confirm it is a feature that the maintainers would like added.

This can easily be worked around by wrapping the <Textfit> in a <div> that is not display: 'flex'. But, I did waste some time trying to figure out why my text wasn't resizing, and I would imagine future users will have the same problem.

@kevinjosethomas
Copy link

Are you sure it doesn't work with flexbox? It seems to work for me

@alekmieczkowski
Copy link

It works if you define the height/width of the element that the text is in.

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

3 participants