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

Single-line single word not clamping and overflowing it's container. #60

Closed
coduder opened this issue Sep 10, 2019 · 1 comment
Closed

Comments

@coduder
Copy link

coduder commented Sep 10, 2019

with reference to #45 i think width clamping would be useful at least as a property that can be passed to the component. I understand if that wasn't the original usecase for the component, but multiple people have asked for it and it would be nice to not have to use a different package because of this one usecase

i have tried using the 'word-break': 'break-all' approach outlined in in the above link, which just causes the entire line to clamp and show the ellipsis, which is also not ideal. You have solved a difficult problem here by having an easy to integrate with react-component package that solves the multi-line ellipsis text problem well, except for this one case.

@coduder coduder changed the title Width Clamping again Single-line single word not clamping and overflowing it's container. Sep 10, 2019
@coduder
Copy link
Author

coduder commented Sep 10, 2019

Actually i'm an idiot,

If your maxLine=1 and your line is made up of one word unbroken by a space (like say a veryyy long e-mail), you should set the basedOn="letters" property and then the style={{ 'word-break': 'break-all'}}. This will effectively break your single word at whichever character it overflows, which will allow this component to effectively clamp it.

@coduder coduder closed this as completed Sep 10, 2019
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