Textualize / textual

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
https://textual.textualize.io/
MIT License
25.54k stars 785 forks source link

Bindings not updated after leaving Select by clicking outside terminal #5157

Open mzebrak opened 1 week ago

mzebrak commented 1 week ago

Clicking outside the terminal collapses the Select menu but does not update the binding.

Video:

Screencast from 10-23-2024 12:37:10 PM.webm

MRE:

from __future__ import annotations

from textual.app import App, ComposeResult
from textual.binding import Binding
from textual.widgets import Footer, Select

class MyApp(App):
    BINDINGS = [
        Binding("escape", "quit()", "Quit app"),
    ]

    def compose(self) -> ComposeResult:
        yield Select([(str(i), i) for i in range(3)])
        yield Footer()

MyApp().run()
github-actions[bot] commented 1 week ago

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

mzebrak commented 1 week ago

Actually, maybe the root issue is that Select shouldn't collapse when you click outside?