Using the tcomb-form-native library with react native - I've set the return key type to be next
. How do I implement the tab/next behavior so that it focuses on the next field in the form?
Asked
Active
Viewed 724 times
3

MonkeyBonkey
- 46,433
- 78
- 254
- 460
1 Answers
3
I can override the onSubmitEditing
property of the options object in the form to specifically set focus on the next form field.
ref={(c) => { this.loginForm = c; }}
options={{
fields: {
email: {
autoCapitalize: 'none',
keyboardType: 'email-address',
error: 'Invalid email',
returnKeyType: 'next',
onSubmitEditing: () => this.loginForm.getComponent('password').refs.input.focus(),
},
password: {
password: true,
secureTextEntry: true,
error: 'Invalid password',
onSubmitEditing: () => this.submit(),
},
},

MonkeyBonkey
- 46,433
- 78
- 254
- 460