question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to start editing on TextInput programmatically and show keyboard

See original GitHub issue

Hello my question is .

Is there any way to programmatically focus and show keyboard for typing on TextInput ?

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 manyally tap on the TextInput in order for it to show the keyboard :

image

Let me know if this is possible

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
lucaswitchcommented, Apr 8, 2022

@goxr3plus the easy fix should be replacing your current paper version 4.12.0 to 4.11.x.

2reactions
lucaswitchcommented, Apr 8, 2022

The current version 4.12.0 has different ref props than the older releases with a lot less attributes.

Read more comments on GitHub >

github_iconTop 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 >
Focusing on TextInput programmatically doesn't start ... - GitHub
I put ref on example TextInput and focus method works just fine, opens keyboard on both android and ios.
Read more >
Working with the Soft Keyboard | CodePath Android Cliffnotes
If you want to test with the soft keyboard, be sure to open up the Android Virtual Device Manager ( Tools => Android...
Read more >
Hide/Show Software Keyboard Programmatically ... - YouTube
In this video I want to show you the KeyboardVisibilityEvent library, which makes it very easy to hide and show the Android software ......
Read more >
Handle input method visibility | Android Developers
When input focus moves in or out of an editable text field, Android shows or hides the input method—such as the on-screen keyboard—as ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found