mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #950] Scroll bars for tables and textviews #697
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#697
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @darkhz on GitHub (Feb 22, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/950
It would be good if scroll bars were shown for tables and textviews, so that the user can be notified about the position of the content and if there is any remaining content to be scrolled to.
@rivo commented on GitHub (Mar 7, 2024):
I don't think this will be added any time soon. Most widgets, especially text views and text areas, don't know their entire content, much less a laid out version of it. They gradually parse and layout text as the user navigates to it. Tables can also be "infinitely" large, see https://github.com/rivo/tview/blob/master/demos/table/virtualtable/main.go for an example. If we wanted to show scrollbars for a text view, for example, we'd have to parse its entire text first, including any style/region tags and word wrapping. This would be a huge performance hit on large texts. (Actually, it was like this in beginning and lots of people complained about bad performance.)
I have plans to add functionality that might make it easier for you to add something like this yourself, however. Can't say right now, though, when this will be available.
@pancsta commented on GitHub (Mar 26, 2025):
I will chime in that cview has a working scrollbar implementation with styling.
@cherio commented on GitHub (May 5, 2025):
There is an alternative approach implemented on many websites. Scrollable areas display scroll bars based on the content already loaded. Scrollbar position adjusts every time more content is loaded. That's the way they solve the problem of "infinite" lists.