File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,12 @@ class OtpInput extends Component<Props, State> {
223
223
}
224
224
} ;
225
225
226
+ // The content may not have changed, but some input took place hence change the focus
227
+ handleInput = ( e : Object ) => {
228
+ this . handleOnChange ( e ) ;
229
+ this . checkLength ( e ) ;
230
+ }
231
+
226
232
checkLength = ( e : Object ) => {
227
233
if ( e . target . value . length > 1 ) {
228
234
e . preventDefault ( ) ;
@@ -255,7 +261,7 @@ class OtpInput extends Component<Props, State> {
255
261
value = { otp && otp [ i ] }
256
262
onChange = { this . handleOnChange }
257
263
onKeyDown = { this . handleOnKeyDown }
258
- onInput = { this . checkLength }
264
+ onInput = { this . handleInput }
259
265
onPaste = { this . handleOnPaste }
260
266
onFocus = { e => {
261
267
this . setState ( { activeInput : i } ) ;
You can’t perform that action at this time.
0 commit comments