-
Notifications
You must be signed in to change notification settings - Fork 266
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
Viewport may not scroll down to the end of large text inputs #479
Comments
Had the same problem. Although now the text at the top is cropped if I scroll too fast. |
It seems that this issue occurs when scrolling down to the bottom of the ViewPort and includes lines that have been soft wrapped. It can be easily reproduced by editing the artichoke.md file at https://github.com/charmbracelet/bubbletea/tree/v0.25.0/examples/pager.
|
same issue here |
I have the same issue, which started when I switched to using glamour for markdown rendering. |
Same issue here: if a line is too long and it wraps to the next line, you can't see the bottom line, and the problem multiplies. |
i wrote a component which do not wrap but clips the line if anyone's interested: #509 |
I was able to solve my problem by diving into Glamour's TermRenderer code and realizing that the WithWordWrap option allows you to specify the overall max width before hard wrapping. I set that to the width of the viewport and everything works as expected. |
Hi, everyone. Traditionally we've left wrapping as an exercise for the user. If you need to solve for this now you can simply wrap manually as was suggested in this thread. wrapped := lipgloss.NewStyle().Width(yourWidth).Render(yourContent)
viewport.SetContent(wrapped) That said, there's a PR for auto-wrapping in #578. |
Viewport may not scroll down to the end of large text inputs. It will work if you reduce viewport height to e.g. 5.
m.contentView = viewport.New(msg.Width, 5)
Use up and down arrows in the example.
The text is cropped after a you reach the end with arrow down.
m.conetntView.ScrollPercent
results in 100.Setup
Example Code
The text was updated successfully, but these errors were encountered: