Skip to content

Tabs.remove_tab does not update the highlighting #5218

New issue

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

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

Already on GitHub? # to your account

Closed
TomJGooding opened this issue Nov 7, 2024 · 2 comments · Fixed by #5233
Closed

Tabs.remove_tab does not update the highlighting #5218

TomJGooding opened this issue Nov 7, 2024 · 2 comments · Fixed by #5233

Comments

@TomJGooding
Copy link
Contributor

Originally posted in #5215 (comment), but this is actually an issue with Tabs where remove_tab does not update the highlighting.

from textual.app import App, ComposeResult
from textual.widgets import Footer, Tab, Tabs


class TabsApp(App):
    BINDINGS = [("r", "remove_foo", "Remove foo")]

    def compose(self) -> ComposeResult:
        yield Tabs(
            Tab("foo", id="foo"),
            Tab("bar", id="bar"),
            active="bar",
        )
        yield Footer()

    def action_remove_foo(self) -> None:
        tabs = self.query_one(Tabs)
        tabs.remove_tab("foo")


if __name__ == "__main__":
    app = TabsApp()
    app.run()
Copy link

github-actions bot commented Nov 7, 2024

We found the following entry 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.

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

Successfully merging a pull request may close this issue.

1 participant