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

Bug? - When the string does not contain spaces it is not clamped #39

Closed
creddy opened this issue Oct 26, 2018 · 9 comments
Closed

Bug? - When the string does not contain spaces it is not clamped #39

creddy opened this issue Oct 26, 2018 · 9 comments
Labels

Comments

@creddy
Copy link

creddy commented Oct 26, 2018

It could be that I'm using the component incorrect. Please correct me if I am.

This is an edge case for sure, but if the string does not contain any spaces it doesn't appear to be clamped.

From the demo

screen shot 2018-10-26 at 5 44 00 pm

@xiaody
Copy link
Owner

xiaody commented Oct 28, 2018

You may need to set props.basedOn='letters' for such case.

@creddy
Copy link
Author

creddy commented Oct 29, 2018

@xiaody Thank you for the quick reply 😄

I attempted setting both letters and words but I am seeing the same issue

@xiaody
Copy link
Owner

xiaody commented Oct 30, 2018

And also you need to add style overflow-wrap: break-word; for the element since the demo sets white-space: pre-wrap; on it.

react-lines-ellipsis only clamps lines, not width. So you need to tell the browser to wrap the line.

@aqqzzz
Copy link

aqqzzz commented Oct 31, 2018

same question, even add style overflow-wrap: break-word;

@aqqzzz
Copy link

aqqzzz commented Nov 2, 2018

image
after add overflow-wrap: break-word

@mzohaibqc
Copy link

@xiaody Facing same issue and even adding style overflow-wrap: break-word; did not work

@JoaoRPF
Copy link

JoaoRPF commented Mar 26, 2019

@xiaody is this problem under evaluation? We are facing the same problem, when there's only one word that does not contain spaces

@xiaody
Copy link
Owner

xiaody commented Mar 28, 2019

@xiaody is this problem under evaluation? We are facing the same problem, when there's only one word that does not contain spaces

As I have said, this is not a bug IMO. Users need to correctly set the props and style for such cases.
Here is a demo https://codesandbox.io/s/zzx438p7l4.

@xiaody xiaody closed this as completed Mar 28, 2019
@JoaoRPF
Copy link

JoaoRPF commented Apr 1, 2019

Check the comments in #45 if you're facing the same problem.

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

5 participants