File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,23 @@ const ReactInputVerificationCode = ({
135135 return ;
136136 }
137137
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+ return ;
153+ }
154+
138155 setValue ( value , index ) ;
139156
140157 /**
@@ -216,6 +233,7 @@ const ReactInputVerificationCode = ({
216233 < div className = 'ReactInputVerificationCode-container' >
217234 { inputsRefs . map ( ( ref , i ) => (
218235 < input
236+ autoComplete = 'one-time-code'
219237 className = 'ReactInputVerificationCode-item'
220238 key = { i }
221239 onChange = { ( event ) => onInputChange ( event , i ) }
You can’t perform that action at this time.
0 commit comments