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

DataTable height: auto; does not account for horizontal scrollbar. #1289

Closed
aaronst opened this issue Nov 25, 2022 · 4 comments
Closed

DataTable height: auto; does not account for horizontal scrollbar. #1289

aaronst opened this issue Nov 25, 2022 · 4 comments

Comments

@aaronst
Copy link
Contributor

aaronst commented Nov 25, 2022

This example creates a DataTable with a height of 2, but I think it should be 3 (header, row, and horizontal scrollbar).

from textual.app import App, ComposeResult
from textual.widgets import DataTable


class Test(App):
    DEFAULT_CSS = """
    DataTable {
        height: auto;
    }
    """

    def compose(self) -> ComposeResult:
        yield DataTable(id="table")

    def on_mount(self) -> None:
        table = self.get_child_by_id("table", DataTable)
        table.add_column("test")
        table.add_row("a" * 200)


Test().run()
@aaronst
Copy link
Contributor Author

aaronst commented Nov 25, 2022

I've been getting around this with min-height: 3;.

@willmcgugan
Copy link
Collaborator

I'm not convinced this should be the case. It means the datatable widget will have to change its dimensions based on the visibility of the scrollbar.

I think in these circumstances you are better off setting the scrollbar to always visible

@davep
Copy link
Contributor

davep commented Aug 24, 2023

Closing as working as intended.

https://label.dev/wontfix/

@davep davep closed this as completed Aug 24, 2023
@github-actions
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

3 participants