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 Truncated with advancedRenderer but Ellipsis Included in New Line #533

Open
soumyaloka opened this issue Apr 25, 2024 · 1 comment
Open

Comments

@soumyaloka
Copy link

When using the advanceRenderer and wordBreak feature in the Lightning framework, we have observed an issue where text is truncated, but instead of adding an ellipsis (...) at the end of the truncated text, the ellipsis is included in a new line, causing unexpected layout behavior.

@ImCoolNowRight
Copy link

I've done some digging and have some more context to help with resolving this issue.

Using this playground, I'd expect that the fifth line to display "wordThatShouldNotOverlfow:(", but truncated, with a suffix appended, and still fitting within the assigned wordWrapWidth. I recreated this playground locally so I could dig into this, and I think I've narrowed down at least an initial problem to this line:

let lastLineText = text.filter((t) => t.lineNo == index)

If I place console.log(lastLineText, text.filter((t) => t.lineNo == index)) on a new line after that one, the two values printed out are not the same. lastLineText equals "..", while running the filter again gives me "wordThatShouldNot", which is expected based on the lineNo that is being filtered. It would seem that the filter is producing the wrong text, and that is what is leading to the ".." to exist on its own line instead of being appended to the correct text that should show on that line.

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

2 participants