Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shapiromatron opened this issue Apr 17, 2024 · 2 comments · Fixed by #4424
Closed

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

shapiromatron opened this issue Apr 17, 2024 · 2 comments · Fixed by #4424

Comments

@shapiromatron
Copy link

shapiromatron commented Apr 17, 2024

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

Copy link

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

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant