Skip to content
Discussion options

You must be logged in to vote

Containers have height: 1fr which means they will divide their space equally in their parent. If you want them to size to their contents, you will need to set height: auto;

from textual.app import App, ComposeResult
from textual.containers import Container, Horizontal, ScrollableContainer
from textual.widgets import Static, Label


class LongSimulator1(Static):
    def compose(self) -> ComposeResult:
        for i in range(10):
            yield Label(f"Widget for Container1 {i}")


class LongSimulator2(Static):
    def compose(self) -> ComposeResult:
        for i in range(10):
            yield Label(f"Widget for Container2 {i}")


class Application(App):
    CSS = """
    ScrollableCon…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vpet98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants