Focusing RkTextInput
See original GitHub issueHi,
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?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
javascript - React Native TextInput focus
Accessing the native element in react native works differently. First you need to create a React.ref that will hold the native element ...
Read more >react-native-ui-kitten/CHANGELOG.md
8, * **rkTextInput:** focus behavior when `onPress` called ([3598613](https://github.com/akveo/react-native-ui-kitten/commit/3598613)).
Read more >Stateless function components cannot hav refs-Reactjs
You're using RkTextInput which is a functional component and it cannot have a ref. That's why you can't focus it. I don't see...
Read more >UI Kitten - Input - component api - GitHub Pages
Called when input field looses focus. placeholder, string. A string to be displayed when there is no value. disabled, boolean.
Read more >Focus on the Next TextInput when Next Keyboard Button is ...
We will use a combination of refs, `onSubmitEditing` callback, `returnKeyType`, and `blurOnSubmit` to move between text inputs when submitted.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, you can focus it with
this.refs.confirmPassword._focusInput()
,I guess we will refactor name of method in future.
Hey! be careful… the function is “the input ref”.focusInput( ); not ._focusInput( ); 😄