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

Text: Text component ignores the remaining width and truncates earlier than expected, if it encounters a long word, which it can't fit in that line #6427

Closed
1 task done
arijitpatra-sap opened this issue Sep 30, 2024 · 2 comments
Labels
released v1 PR or issue only relevant for v1

Comments

@arijitpatra-sap
Copy link
Member

Describe the bug

I observed a case, where the Text component ignores the remaining width and truncates earlier than expected, if it encounters a long word, which it can't fit in that line. This can look confusing and seems like sub-optimal usage of the real-estate.

I tried locally, this seems to be solvable using CSS word-break: break-all. I was thinking if this can be changed in the component level (if there aren't any issue) then it will be nice for everyone and for consistency.

Component 1

Isolated Example

No response

Reproduction steps

Try with a very very long word, make up something... and make sure maxLines is 1.

Expected Behaviour

The ellipses should be shown at the end of the line

Screenshots or Videos

Component 1
Screenshot 2024-09-30 at 5 40 43 PM
Screenshot 2024-09-30 at 5 46 57 PM

UI5 Web Components for React Version

both v1 and v2

UI5 Web Components Version

not sure... whatever is used with @ui5/webcomponents-react v1 and v2

Browser

Chrome

Operating System

No response

Additional Context

No response

Relevant log output

No response

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.
@Lukas742
Copy link
Contributor

Lukas742 commented Oct 2, 2024

Hi @arijitpatra-sap

as discussed internally, wrapping needs to be set to true for maxLines to work properly. The linked PR outlines this better and also fixes the behavior with maxLines <= 1:

  • maxLines <=1: the same behavior as wrapping: false is applied.
  • maxLines > 1: i.a. word-wrap: break-word; is applied

@ui5-webcomponents-react-bot
Copy link
Contributor

🎉 This issue has been resolved in version v1.29.12 🎉

The release is available on v1.29.12

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released v1 PR or issue only relevant for v1
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants