textual
textual copied to clipboard
`TextArea` with indent tab behaviour won't minimize on `esc` key
I'm not sure what default behaviour is expected in this scenario, but consider this simple example containing a TextArea.code_editor. After maximizing this widget, pressing the esc key won't minimize it again because it is expected this will instead move focus.
from textual.app import App, ComposeResult
from textual.containers import Vertical
from textual.widgets import TextArea
TEXT = """\
def hello(name):
print("hello" + name)
def goodbye(name):
print("goodbye" + name)
"""
class TextAreaExample(App):
CSS = """
Screen {
align: center middle;
}
#code-container {
width: 20%;
height: 20%;
}
"""
def compose(self) -> ComposeResult:
with Vertical(id="code-container"):
yield TextArea.code_editor(TEXT, language="python")
app = TextAreaExample()
if __name__ == "__main__":
app.run()
It's intended to minimize: https://github.com/Textualize/textual/pull/4931#discussion_r1731011637
Good catch, the minimize should be done earlier.