From fff47ee40af19b7cfa61ffa9d658595955c568da Mon Sep 17 00:00:00 2001 From: rizky Date: Thu, 31 Oct 2024 03:21:51 -0700 Subject: [PATCH] fix otp --- comps/form/field/type/TypeOTP.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/comps/form/field/type/TypeOTP.tsx b/comps/form/field/type/TypeOTP.tsx index d295124..f7f35a0 100755 --- a/comps/form/field/type/TypeOTP.tsx +++ b/comps/form/field/type/TypeOTP.tsx @@ -25,7 +25,6 @@ export const FieldOTP: FC<{
{local.otp.map((item, idx) => ( {}} + inputMode="decimal" + pattern="[0-9]*" value={item} ref={(ref) => { if (ref) local.ref[idx] = ref; @@ -79,8 +79,10 @@ export const FieldOTP: FC<{ const otp = local.otp.join(""); fm.data[field.name] = otp; - fm.render(); - local.render(); + if (otp.length === digit) { + fm.render(); + } + // local.render(); }} /> ))}