fix otp
This commit is contained in:
parent
ce26b706c6
commit
fff47ee40a
|
|
@ -25,7 +25,6 @@ export const FieldOTP: FC<{
|
||||||
<div className="c-flex-1 c-flex c-justify-center c-items-center">
|
<div className="c-flex-1 c-flex c-justify-center c-items-center">
|
||||||
{local.otp.map((item, idx) => (
|
{local.otp.map((item, idx) => (
|
||||||
<input
|
<input
|
||||||
type="text"
|
|
||||||
key={idx}
|
key={idx}
|
||||||
className={cx(
|
className={cx(
|
||||||
"c-rounded-md c-text-center",
|
"c-rounded-md c-text-center",
|
||||||
|
|
@ -39,7 +38,8 @@ export const FieldOTP: FC<{
|
||||||
background: white;
|
background: white;
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
onChange={() => {}}
|
inputMode="decimal"
|
||||||
|
pattern="[0-9]*"
|
||||||
value={item}
|
value={item}
|
||||||
ref={(ref) => {
|
ref={(ref) => {
|
||||||
if (ref) local.ref[idx] = ref;
|
if (ref) local.ref[idx] = ref;
|
||||||
|
|
@ -79,8 +79,10 @@ export const FieldOTP: FC<{
|
||||||
|
|
||||||
const otp = local.otp.join("");
|
const otp = local.otp.join("");
|
||||||
fm.data[field.name] = otp;
|
fm.data[field.name] = otp;
|
||||||
fm.render();
|
if (otp.length === digit) {
|
||||||
local.render();
|
fm.render();
|
||||||
|
}
|
||||||
|
// local.render();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue