Textualize/textual

Docs change - use `pane` instead of `tab` for an event listener on tab change

Closed this issue · 2 comments

We tried adding an event listener for a tab change using the docs here, but couldn't get it to work: https://textual.textualize.io/guide/events/#applying-css-selectors-to-arbitrary-attributes. Should the docs be updated to use pane instead of tab, or are we doing something wrong? Specifically this snippet:

@on(TabbedContent.TabActivated, tab="#home")
def home_tab(self) -> None:
    self.log("Switched back to home tab.")

I got it working, I think it's related to the breaking change described in https://github.com/Textualize/textual/blob/main/CHANGELOG.md#0460---2023-12-17

Breaking change: tab is no longer a @on decorator selector for TabbedContent.TabActivated -- use pane instead #3815

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

Don't forget to star the repository!

Follow @textualizeio for Textual updates.