Support "next to be focussed" args to async form handlers
parent
ac35e26d9a
commit
f2376f90ad
|
@ -334,6 +334,7 @@ async def handle_field_input(
|
||||||
recv_chan: trio.abc.ReceiveChannel,
|
recv_chan: trio.abc.ReceiveChannel,
|
||||||
form: FieldsForm,
|
form: FieldsForm,
|
||||||
model: pydantic.BaseModel, # noqa
|
model: pydantic.BaseModel, # noqa
|
||||||
|
focus_next: QWidget,
|
||||||
|
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
|
@ -356,7 +357,8 @@ async def handle_field_input(
|
||||||
}:
|
}:
|
||||||
|
|
||||||
widget.clearFocus()
|
widget.clearFocus()
|
||||||
form.godwidget.focus()
|
# normally the godwidget
|
||||||
|
focus_next.focus()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# process field input
|
# process field input
|
||||||
|
@ -414,7 +416,8 @@ def mk_form(
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def open_form_input_handling(
|
async def open_form_input_handling(
|
||||||
|
|
||||||
form: FieldsForm
|
form: FieldsForm,
|
||||||
|
focus_next: QWidget,
|
||||||
|
|
||||||
) -> FieldsForm:
|
) -> FieldsForm:
|
||||||
|
|
||||||
|
@ -431,6 +434,7 @@ async def open_form_input_handling(
|
||||||
handle_field_input,
|
handle_field_input,
|
||||||
form=form,
|
form=form,
|
||||||
model=form.model,
|
model=form.model,
|
||||||
|
focus_next=focus_next,
|
||||||
),
|
),
|
||||||
|
|
||||||
# block key repeats?
|
# block key repeats?
|
||||||
|
|
Loading…
Reference in New Issue