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

Wrong line breaks #161

Open
noahsol30 opened this issue May 16, 2023 · 0 comments
Open

Wrong line breaks #161

noahsol30 opened this issue May 16, 2023 · 0 comments

Comments

@noahsol30
Copy link

noahsol30 commented May 16, 2023

Sometimes upon first component load the react-truncate component will render the text with broken lines. I've checked previous issues opened here and saw that it's a know limitation.
I understand that this happens when the custom font has loaded after the component has rendered. We have written a code that verifies it :
document.fonts.ready.then(() => { {render the component } })

We have limited the number of lines to 2 but sometimes we get it as 4 breaking the whole component:
Lorem ipsum dolor sit amet,Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Duis dui

Read more

But we are still getting reports of line breaks with the suggested work around. We have also tried lowering the letter spacing but there is also a limit to how much we can reduce it.

What can be done in such case? Any ideas?

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