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.

Text box not visible when keyboard active using expo

See original GitHub issue

Issue Description

Text bot is invisible when keyboard active in android with expo. I’m usingforceGetKeyboardHeight={true} and the message content moves correctly but there is an empty space instead of the textbox. screenshot_2017-12-26-18-51-19-590_host exp exponent

screenshot_2017-12-26-18-50-57-697_host exp exponent

Steps to Reproduce / Code Snippets

<GiftedChat
        messages={this.state.messages}
        forceGetKeyboardHeight={true}
        onSend={(messages) => this.onSend(messages)}
        user={{
          _id: 1,
        }}
      />

Expected Results

The text box should be visible.

Additional Information

  • Nodejs version: 8.9.3
  • React version: 16.0.0
  • React Native version: expo react native sdk 23.0.0
  • react-native-gifted-chat version: 0.3.0
  • expo version: 23.0.0
  • Platform(s) (iOS, Android, or both?): Tested on android

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:21 (1 by maintainers)

github_iconTop GitHub Comments

49reactions
akulah91commented, Mar 31, 2018

I got it… Just do like this…

 <View  style={{flex:1}}>
          <GiftedChat

            messages={this.state.messages} 
            onSend={messages => this.onSend(messages)}
            user={{
              _id: 1,
            }}
              ></GiftedChat>

            <KeyboardAvoidingView behavior={'padding'} keyboardVerticalOffset={80}/>
        </View>

need to declare flex to parent view to make it works. 👍

7reactions
christopher-18commented, Dec 29, 2017

I had the same issue , but in my case textInputBar was pushing above the keyboard but its view was coming partially. <KeyboardAvoidingView behavior={'padding'} style={{flex:1}} keyboardVerticalOffset={30}> <ChatBot/> </KeyboardAvoidingView> fixed my problem. Here <ChatBot/> is my component where I have called GiftedChat . Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextInput Not Visible When Keyboard Is Open Expo React ...
This is my view and this happens when I open the soft keyboard, I'm running on the latest Expo and React Native, the...
Read more >
Prevent the On-screen Keyboard from Covering up Text Inputs
[00:34] First, make sure it fills the entire screen by setting a flex one style prop. Then we'll replace the main container view...
Read more >
How to make your React Native app respond gracefully when ...
The first thing you have to do is replace the container View with the KeyboardAvoidingView and then add a behavior prop to it....
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 >
Using the KeyboardAvoidingView in React Native
If you choose to use more than one input field and all the other fields are not viewable on the screen, you can...
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