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

Font size doesn't update, when the height of the div is reduced. #83

Open
Johannes5 opened this issue Jul 30, 2021 · 1 comment
Open

Comments

@Johannes5
Copy link

Johannes5 commented Jul 30, 2021

Demo video:
https://www.loom.com/share/e1a54f0ee4ac4d6c93fedf24c100ec8d

When the text length changes from a length spanning multiple lines, to a smaller text requiring only one line, the font size doesn't update. It will keep its previous font size until the length of the incoming text spans more than one line and shifts the height of the div back to i's maxHeight.

the API is used like this
title={(<Textfit max={20}> {article.title} </Textfit>)}

@Johannes5
Copy link
Author

it might be worth noting, that inserting
window.dispatchEvent(new CustomEvent('resize'));
(as suggested by @ShaMan123 in #82 )
into the component forces everything to be in one line

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

1 participant