how to focus next Input onSubmitEditing using useRef
See original GitHub issueunable to focus next input when pressed enter.
const attNameRef = useRef(null);
<Input
getRef={input => {
attNameRef= input;
}}
onSubmitEditing={() => {
attNameRef._root.focus();
}}
/>
undefined is not obj
how can I use onSubmitEditing with useRef?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
React Native: How to select the next TextInput after pressing ...
Bind focus function to first TextInput's onSubmitEditing event. ... import React, { useRef } from 'react' ... const MyFormComponent = () => {...
Read more >Focus on the Next TextInput when Next Keyboard Button is ...
The first step is getting a ref to our Last Name input. The one we want to focus on after our first input...
Read more >[Solved]-How focus the next field input in react native?-Reactjs
Coding example for the question How focus the next field input in react native? ... import React, { useRef } from 'react'; ......
Read more >Focusing Next Input in React Native - David Tran
// ... render() { return ( <TextInput blurOnSubmit={false} onSubmitEditing={() => this.passwordRef.focus()} /> <TextInput ref={ref => this.
Read more >4 Ways to Set Focus on an Input Field After Rendering in React
1. Autofocus in HTML · 2. Setting up React project · 3. Autofocus using React Hooks useRef · 4. Autofocus using React class...
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
I think I figured it out: