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

next.js - truncation not occurring until window resized #86

Open
oldo opened this issue Jun 3, 2020 · 1 comment
Open

next.js - truncation not occurring until window resized #86

oldo opened this issue Jun 3, 2020 · 1 comment
Labels

Comments

@oldo
Copy link

oldo commented Jun 3, 2020

Hi there, I am using react-text-truncate on a SSR project using next.js and am finding that on initial page load the text is un-truncated, although truncation occurs after resizing the window:

Initial page load:
Screen Shot 2020-06-03 at 14 46 41

After window resized:
Screen Shot 2020-06-03 at 14 46 57

Has anyone come across this issue before and is there a way around it?
Thanks!

@ShinyChang
Copy link
Owner

Hi @oldo,
This module is using the canvas to dynamic calculate the text length base on the bounding box of the container. But It should truncate the text after mounted...

I didn't setup the SSR project with next.js before, maybe it has some different behavior.
Will be better if you can provide me the MVP of this issue then I can look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants