Skip to content

Commit e6549ce

Browse files
committed
fix(keys): initially focus the key log
When running `textual keys`, currently the 'Clear' button will have initial focus. This can be confusing if you're trying to test the `enter` key with some modifiers, as this might invoke a button press! This simply re-orders the composed widgets so the key log is initially focussed instead.
1 parent 6485ab6 commit e6549ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/textual_dev/previews/keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ class KeysApp(App[None], inherit_bindings=False):
4040

4141
def compose(self) -> ComposeResult:
4242
yield Header()
43+
yield KeyLog()
4344
yield Horizontal(
4445
Button("Clear", id="clear", variant="warning"),
4546
Button("Quit", id="quit", variant="error"),
4647
id="buttons",
4748
)
48-
yield KeyLog()
4949

5050
def on_ready(self) -> None:
5151
self.query_one(KeyLog).write(Panel(Text.from_markup(INSTRUCTIONS)), expand=True)

0 commit comments

Comments
 (0)