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

use word-wrap and add line break controls #2460

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

patricklx
Copy link
Collaborator

sorry for pr again...
found this issue when a small component is at the right side
image

@patricklx
Copy link
Collaborator Author

found this https://www.fileformat.info/info/unicode/char/200b/index.htm
with this we can control where line breaks are in addition allowed. I added them around the / character

@patricklx patricklx changed the title use word-wrap instead of break-word use word-wrap and add line break controls Sep 5, 2023
@RobbieTheWagner
Copy link
Member

@patricklx it feels like we're playing whack-a-mole with this issue. I don't think we should be specifying which characters we wrap on. We need to set a max-width on the container for this text and just have it auto wrap.

@patricklx
Copy link
Collaborator Author

patricklx commented Sep 5, 2023

with word-wrap: break-word; it only breaks the word when max-width is reached. before it was breaking even sooner. causing issues.
specifying the character is just a nice plus point. otherwise it will auto-wrap anywhere in the word. But if it finds a better spot to break on it uses that instead. Since we always have some / chars in the path, we can use that. (by default it will not break on them, it only breaks on spaces and -, maybe others as well).
if there is no /, it will also just use default behaviour and break the word anywhere

@RobbieTheWagner
Copy link
Member

with word-wrap: break-word; it only breaks the word when max-width is reached. before it was breaking even sooner. causing issues. specifying the character is just a nice plus point. otherwise it will auto-wrap anywhere in the word. But if it finds a better spot to break on it uses that instead. Since we always have some / chars in the path, we can use that. (by default it will not break on them, it only breaks on spaces and -, maybe others as well). if there is no /, it will also just use default behaviour and break the word anywhere

I'm not sure I fully understand. Perhaps we need a min-width as well to make sure it doesn't get so small? I would prefer not to manually specify where it breaks, but rely on default behavior.

@patricklx
Copy link
Collaborator Author

it works well with word-wrap: break-word without specifying min-width.
default behaviour just looks ugly, when it breaks the word anywhere, because it cannot find a good point to break the word.

@patricklx
Copy link
Collaborator Author

patricklx commented Sep 5, 2023

this on ember website with small window:

with specifying breaking points:
image

and without:

image

@RobbieTheWagner RobbieTheWagner merged commit a515331 into emberjs:main Nov 3, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants