Skip to content

Commit

Permalink
focus game
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Nov 24, 2024
1 parent 7eabc19 commit ac0dfcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/textual/demo/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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()
Expand Down

0 comments on commit ac0dfcf

Please sign in to comment.