Focusing on TextInput programmatically doesn't start also editing with keyboard
See original GitHub issueHello
I have created a ref to TextInput as follows :
<TextInput
ref={inputRef}
style={styles.textInput}
label='Update reason here..'
value={reason}
onChangeText={text => setReason(text)}
/>
and tried something like this :
const inputRef = useRef()
useEffect(()=>{
console.log(inputRef.current)
inputRef.current.focus()
},[])
But it just focuses the TextInput
I need it also to show the keyboard like below instead of the user having to manuallytap on the TextInput in order for it to show the keyboard :
Your Environment
software | version |
---|---|
ios or android | 11 |
react-native | 0.64 |
react-native-paper | 4.12.0 |
node | 16 |
npm or yarn | 6.12 |
expo sdk | 44 |
Issue Analytics
- State:
- Created a year ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
How can I set the focus (and display the keyboard) on my ...
Try this: EditText editText = (EditText) findViewById(R.id.myTextViewId); editText.requestFocus(); InputMethodManager imm = (InputMethodManager) ...
Read more >HTMLElement.focus() - Web APIs | MDN
focus () method sets focus on the specified element, if it can be focused. The focused element is the element that will receive...
Read more >Focusing: focus/blur - The Modern JavaScript Tutorial
An element receives the focus when the user either clicks on it or uses the Tab key on the keyboard. There's also an...
Read more >TextInput - React Native
A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, ...
Read more >How to dismiss the keyboard for a TextField - Hacking with Swift
If you're supporting only iOS 15 and later, you can activate and dismiss the keyboard for a text field by focusing and unfocusing...
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 FreeTop 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
Top GitHub Comments
@lukewalczak Still not working with forceFocus … let me show you on the gif below
It just focuses the text but never showing the keyboard … I have to manually press again the text
Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.