From ed49ad4ce7d09b1a582768b4b8e6dba7ddc6997d Mon Sep 17 00:00:00 2001 From: Markus Thielker Date: Wed, 25 Dec 2024 17:56:41 +0100 Subject: [PATCH] N-FIN-86: fix payor input always focus next --- src/components/form/paymentForm.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/form/paymentForm.tsx b/src/components/form/paymentForm.tsx index 38bbc4d..87bacb1 100644 --- a/src/components/form/paymentForm.tsx +++ b/src/components/form/paymentForm.tsx @@ -69,6 +69,7 @@ export default function PaymentForm({value, entities, categories, onSubmit, clas const payeeRef = useRef({} as HTMLInputElement); const categoryRef = useRef({} as HTMLInputElement); + const submitRef = useRef({} as HTMLButtonElement); return (
@@ -149,7 +150,9 @@ export default function PaymentForm({value, entities, categories, onSubmit, clas {...field} onChange={(e) => { field.onChange(e); - payeeRef && payeeRef.current.focus(); + if (e && e.target.value) { + payeeRef && payeeRef.current.focus(); + } }}/>