Hi,
I tried to implement the code to focus on the next text input field but I cannot get it to work.
<RkTextInput style={InputStyles.inputContainer} labelStyle={InputStyles.label}
inputStyle={InputStyles.text} label='Password' placeholder="minimum 8 characters"
secureTextEntry={true} autoCapitalize='none' autoCorrect={false}
returnKeyType='next'
keyboardType='default' ref="password"
onSubmitEditing={() => this.refs.confirmPassword.focus() }/>
Any idea on how I can focus on the next RkTextInput please?
Hi, you can focus it with this.refs.confirmPassword._focusInput(),
I guess we will refactor name of method in future.
@SashaSkywalker Great thanks, it worked! I saw the _focusInput method being used in the component but I could not figure out how I could use it.
@SashaSkywalker How can this.refs.confirmPassword._focusInput() focus on the next RkTextInput???
I have two RkTextInput, and I put the above code inside the first RkTextInput, it didn't work!
<RkTextInput
label={<FeatherIcon name={'user'} />}
placeholder='Account'
keyboardType="email-address"
autoCapitalize="none"
returnKeyType="next"
onSubmitEditing={() => this.refs.confirmPassword._focusInput() }
/>
<RkTextInput
label={<FeatherIcon name={'lock'} />}
placeholder='Password'
secureTextEntry={true}
/>
@SaveYourTime You need to add ref='confirmPassword' to password input:
<RkTextInput
ref='confirmPassword'
label={<FeatherIcon name={'lock'} />}
placeholder='Password'
secureTextEntry={true}
/>
Hey! be careful... the function is "the input ref".focusInput( ); not ._focusInput( ); :D
Most helpful comment
Hi, you can focus it with
this.refs.confirmPassword._focusInput(),I guess we will refactor name of method in future.