How to autofocus next TextInput on react-native

前端 未结 6 1653
迷失自我
迷失自我 2020-12-15 00:23

I\'m trying to create a passcode protected screen. The screen will uses 4 numeric input as the passcode.

The way I\'m doing this is create a TextInput Component and

6条回答
  •  自闭症患者
    2020-12-15 01:11

    I think the issue is that onSubmitEditing is when you hit the "return" or "enter" key on the regular keyboard... there is not one of those buttons on the keypad.

    Assuming you want each input to only have one character, you could look at the onChangeText and then check if text has length 1 and call focus if the length is indeed 1.

提交回复
热议问题