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

Table: Add scrollbar to table widget #173

Open
lcmgh opened this issue May 10, 2023 · 3 comments
Open

Table: Add scrollbar to table widget #173

lcmgh opened this issue May 10, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@lcmgh
Copy link

lcmgh commented May 10, 2023

Problem

I noticed the table widget is already scrollable via keyboard navigation: https://github.com/tui-rs-revival/ratatui/blob/main/examples/table.rs

But it is lacking of a scrollbar.

Relates to #146

Solution

Add a config scrollbar: bool option or something similar that integrates a scrollbar to visualize the current position.

@lcmgh lcmgh added the enhancement New feature or request label May 10, 2023
@joshka
Copy link
Member

joshka commented May 10, 2023

Perhaps @gibbz00 has some input on this? They mentioned that they were experimenting with Viewport scrolling a little while ago in #96 (comment). It might be related a little.

I wonder whether the entire concept of scrolling shouldn't be pulled out of widgets themselves and into something a little higher level (in a similar fashion to how block acts?). I'm not sure how that would look though.

@gibbz00
Copy link

gibbz00 commented Sep 22, 2023

Close this now that #228 has landed?

@joshka
Copy link
Member

joshka commented Sep 22, 2023

I think I'd still like to consider adding scrollbars to the widget as part of the config - e.g. what if table looks something like:

Table::new(rows).scrollbar(Scrollbar::new()...))

Instead of having to manually lay this out? I'm not sure what the right way to do this is, so would definitely want someone to investigate this first.

@joshka joshka changed the title Add scrollbar to table widget Table: Add scrollbar to table widget Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants