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.

[Android - Modal ] TextInput doesn't get focus

See original GitHub issue

Hello, I have 3 TextInput in a Modal, sadly some of the TextInput don’t get focus unless you click them twice. To be more accurate when you click the first time they seem to loose the focus as soon as they get them…

<Modal
    animated={true}
    visible={this.props.visibility}
    onRequestClose={()=> this.props._hideModal()} >
    <View style={{backgroundColor:'#ededed'}}>
        <TextInput />
        <TextInput />
        <TextInput />
    </View>
</Modal>

Another thing is that the status bar get the default grey color when the modal shows up Im using 0.23.1 on Windows and I’ve only test this on Android

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
eeeman1commented, Apr 9, 2018

what is the solution to the problem? problem still exists. react-native v0.52

3reactions
grabboucommented, May 31, 2016

I am having the same issue when I present TextInput inside modal with autoFocus on iOS. It works on Simulator, but on device, when modal is presented, keyboard doesn’t open. What’s more, the input itself is not focusable - that is any taps won’t trigger the keyboard. Turning that feature off solves the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextInput sometimes doesn't focus when located in a Modal
When I open my Modal then I immediately tap the TextInput to get the focus, sometimes I have to tap twice before I...
Read more >
TextInput - React Native
Two methods exposed via the native element are .focus() and .blur() that will focus or blur the TextInput programmatically. Note that some props ......
Read more >
How to autoFocus a TextInput field within a Modal in React ...
I think the problem likely has to do with how the <Modal/> component is designed. You typically embed the <Modal/> on a screen...
Read more >
Focus and text fields - Flutter documentation
To give focus to a text field as soon as it's visible, use the autofocus property. content_copy. TextField( autofocus: true, );.
Read more >
Setting Focus For Accessibility In React Native - Dev Genius
There are times when you need to force the focus onto an element. In my case, I ran into an issue where a...
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