simplify compose

This commit is contained in:
Will McGugan
2022-10-15 13:07:15 +01:00
parent babf5beefc
commit 8982d88f9e
8 changed files with 120 additions and 35 deletions

View File

@@ -23,6 +23,11 @@ class DictionaryApp(App):
yield Input(placeholder="Search for a word")
yield Content(Static(id="results"), id="results-container")
def on_mount(self) -> None:
"""Called when app starts."""
# Give the input focus, so we can start typing straight away
self.query_one(Input).focus()
async def on_input_changed(self, message: Input.Changed) -> None:
"""A coroutine to handle a text changed message."""
if message.value: