Skip to content

Commit 74e204b

Browse files
committed
Almost. We don't want a submit when switching to another window, so
only do it when TAB is pressed.
1 parent 497ad5f commit 74e204b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/installer/widgets.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ def render(self) -> RenderResult:
5555

5656

5757
class MInput(Input):
58-
# A version of input that also runs the submit action on blur (seems silly from a UI
59-
# perspective to allow moving the focus from this input without the value being
58+
# A version of input that also runs the submit action when the tab button is pressed (seems
59+
# silly from a UI perspective to allow moving the focus from this input without the value being
6060
# committed to whatever model is underneath.
6161

62-
async def _on_blur(self, event: Blur) -> None: # type: ignore
63-
super()._on_blur(event)
62+
BINDINGS = [('tab', 'tab_pressed')]
63+
64+
65+
async def action_tab_pressed(self) -> None:
6466
await self.action_submit()

0 commit comments

Comments
 (0)