Skip to content

Commit c6865c0

Browse files
committed
feat: try to make otp works
1 parent cb7b712 commit c6865c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ const ReactInputVerificationCode = ({
131131
*/
132132
if (eventValue.length > 1) {
133133
console.log('RIVC: isOtp');
134+
console.log('RIVC: isOtp:focusedIndex', focusedIndex, index);
134135

135136
console.log('RIVC: fillValues(eventValue)', fillValues(eventValue));
136137
setValues(fillValues(eventValue));
@@ -245,7 +246,7 @@ const ReactInputVerificationCode = ({
245246
<div className='ReactInputVerificationCode-container'>
246247
{inputsRefs.map((ref, i) => (
247248
<input
248-
autoComplete='one-time-code'
249+
{...(focusedIndex === i && { autoComplete: 'one-time-code' })}
249250
className='ReactInputVerificationCode-item'
250251
key={i}
251252
onChange={(event) => onInputChange(event, i)}

0 commit comments

Comments
 (0)