Skip to content

Commit 07e9426

Browse files
authored
Merge pull request #4424 from TomJGooding/docs-update-tab-activated-on-decorator-selector
docs: update TabActivated on decorator selector
2 parents 787331e + d788bcf commit 07e9426

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/guide/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ The `on` decorator also accepts selectors as keyword arguments that may be used
268268
The snippet below shows how to match the message [`TabbedContent.TabActivated`][textual.widgets.TabbedContent.TabActivated] only when the tab with id `home` was activated:
269269

270270
```py
271-
@on(TabbedContent.TabActivated, tab="#home")
271+
@on(TabbedContent.TabActivated, pane="#home")
272272
def home_tab(self) -> None:
273273
self.log("Switched back to home tab.")
274274
...

src/textual/_on.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def quit_button(self) -> None:
4343
Example:
4444
```python
4545
# Handle the activation of the tab "#home" within the `TabbedContent` "#tabs".
46-
@on(TabbedContent.TabActivated, "#tabs", tab="#home")
46+
@on(TabbedContent.TabActivated, "#tabs", pane="#home")
4747
def switch_to_home(self) -> None:
4848
self.log("Switching back to the home tab.")
4949
...

0 commit comments

Comments
 (0)