-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Hello! I just started building an app with Textual and encountered an issue. I'm using my custom widgets within TabbedContent, but they are not displayed.
If I wrap them in a Container, it's working.
Here's my code:
class CustomWidget(Widget):
def compose(self) -> ComposeResult:
yield Label("My custom widget")
class DemoApp(App):
def compose(self) -> ComposeResult:
yield Header()
with TabbedContent():
with TabPane("Start", id="start"):
yield Label("Welcome")
yield CustomWidget()
yield Footer()Result:
When I wrap the CustomWidget in a container:
class CustomWidget(Widget):
def compose(self) -> ComposeResult:
yield Label("My custom widget")
class DemoApp(App):
def compose(self) -> ComposeResult:
yield Header()
with TabbedContent():
with TabPane("Start", id="start"):
yield Label("Welcome")
with Container():
yield CustomWidget()
yield Footer()Result:
Additionally, if I put two widgets inside the same container, only the first one is rendered.
Does anyone have an idea how to fix this?
Metadata
Metadata
Assignees
Labels
No labels