We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4a5bf6 commit f315fe3Copy full SHA for f315fe3
1 file changed
src/index.tsx
@@ -135,6 +135,23 @@ const ReactInputVerificationCode = ({
135
return;
136
}
137
138
+ /**
139
+ * otp code
140
+ */
141
+ if (value.length > 1) {
142
+ setValues(fillValues(eventValue));
143
+
144
+ const isCompleted = eventValue.length === length;
145
146
+ if (isCompleted) {
147
+ onCompleted(eventValue);
148
+ blurInput(index);
149
+ return;
150
+ }
151
152
153
154
155
setValue(value, index);
156
157
/**
@@ -216,6 +233,7 @@ const ReactInputVerificationCode = ({
216
233
<div className='ReactInputVerificationCode-container'>
217
234
{inputsRefs.map((ref, i) => (
218
235
<input
236
+ autoComplete='one-time-code'
219
237
className='ReactInputVerificationCode-item'
220
238
key={i}
221
239
onChange={(event) => onInputChange(event, i)}
0 commit comments