-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
affect behavior of return key - tab to next field? #96
Comments
You can use the onSubmitEditing property on React Native's TextInput. Set it in the options like this:
If you can find the field in onSubmitEditing, you could use your field order to focus the next. |
@remcoanker is right. This is more a |
I could not use this solution since my options are defined outside the class. this.refs.form.getComponent... syntax is undefined at that point. Is there any way you could refer to the next input-field without having to use "this.refs.form"-syntax? |
@Mikaila94 got the same problem, options defined outside the field. Any luck? |
Having the same issue, getting undefined for this.refs |
+1 |
1 similar comment
+1 |
Hi @Mikaila94, did you find a way? |
I think this is non-professional solution
finally:
Best regards. |
@mtx62 working but killing the app later like fetch not available anymore gotta be very very careful with this |
To fix this issue you should just save yourself the hassle and define options inline on the Example: const { Form } = t.form;
const formModel = t.struct({
username: t.String,
password: t.String,
});
...
<Form
ref={(c) => { this.formRef = c; }}
type={formModel}
options={{
fields: {
username: {
autoCapitalize: 'none',
autoCorrect: false,
autoFocus: true,
returnKeyType: 'next',
onSubmitEditing: () => this.formRef.getComponent('password').refs.input.focus(),
},
password: {
secureTextEntry: true,
returnKeyType: 'done',
onSubmitEditing: () => this.onPress(),
},
},
}}
/> |
yep @tonycoco method works! but is not there really a way to continue using a variable or constant? thanks for now! |
I am using react native 0.14 and tcomb-form-native 0.3.2. I am testing on an iPad simulator, iOS9.
I can't figure out how to make the Next/Done key on the keyboard go to the next form field. I am able to set the options to show Next, by doing returnKeyType: "next," but the button always just hides the keyboard.
I tried to read the docs but couldn't make headway on this. I tried to set the order of the fields, but that did not work.
The text was updated successfully, but these errors were encountered: