Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
✨ Test code for Textualize/textual#2807
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Jun 19, 2023
1 parent c9cf256 commit 421bac9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tabbed_content_remove_bug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from textual.app import App, ComposeResult
from textual.widgets import TabbedContent, TabPane, Label, Footer

class TabbedContentRemoveBug(App[None]):

BINDINGS = [
("delete", "delete"),
]

def compose(self) -> ComposeResult:
with TabbedContent():
with TabPane("Keep me", id="keep-me"):
yield Label("Keep me")
with TabPane("Remove me", id="remove-me"):
yield Label("Remove me")
yield Footer()

def action_delete(self) -> None:
self.query_one(TabbedContent).remove_pane("remove-me")

if __name__ == "__main__":
TabbedContentRemoveBug().run()

0 comments on commit 421bac9

Please sign in to comment.