From ac0dfcf0a1e1a23641d9f8c8f70fdb7f597451d1 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 24 Nov 2024 11:47:25 +0000 Subject: [PATCH] focus game --- src/textual/demo/game.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textual/demo/game.py b/src/textual/demo/game.py index 6b77714fd2..8a8e6797e5 100644 --- a/src/textual/demo/game.py +++ b/src/textual/demo/game.py @@ -506,7 +506,6 @@ def on_tile_clicked(self, event: events.Click) -> None: class GameScreen(PageScreen): """The screen containing the game.""" - AUTO_FOCUS = "Game" BINDINGS = [ ("s", "shuffle", "Shuffle"), ("n", "new_game", "New Game"), @@ -531,6 +530,7 @@ async def new_game(self, new_game: NewGame | None) -> None: game.language = new_game.language game.dimensions = Size(*new_game.size) await game.recompose() + game.focus() def on_mount(self) -> None: self.action_new_game()