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.


<GiftedChat
messages={this.state.messages}
forceGetKeyboardHeight={true}
onSend={(messages) => this.onSend(messages)}
user={{
_id: 1,
}}
/>
The text box should be visible.
And if you remove props forceGetKeyboardHeight?
@xcarpentier Then the screen does not get resized, the view remains the same and keyboard comes over it. I'm was able to fix it by removing the props forceGetKeyboardHeight and using KeyboardSpacer
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
Hope this helps.
Same issue here - also only on Android.
"react": "16.0.0-alpha.12",
"react-native": "0.48.3",
"react-native-gifted-chat": "^0.2.7",
Same with
"expo": "^24.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-24.0.0.tar.gz"
(RN 0.52)
"react-native-gifted-chat": "^0.2.7",
` `
return (
messages={ChatsStore.messages.slice()}
onSend={(messages) => this.onSend(messages)}
user={{
_id: UserStore.user.id,
name: UserStore.user.firstname,
avatar: UserStore.user.avatar
}}
/>
);
Hello,
Sorry about that.
There are almost 2 solutions to fix it:
@xcarpentier What do you mean by after GiftedChat? Like this:
<View>
<GiftedChat
messages={this.state.messages}
onSend={this.onSend}
user={{
_id: 1
}}
forceGetKeyboardHeight
/>
<KeyboardAvoidingView />
</View>
This and wrapping GiftedChat with KeyboardAvoidingView does not fix the issue. I am using:
"expo": "^25.0.0",
"react": "16.2.0",
"react-native": "0.52.0",
"react-native-gifted-chat": "^0.4.3",
Screenshot:

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. 馃憤
@akulah91
I was wondering if you get this issue where the messages disappear when you type things.
Here is my code:
<View style={{ flex: 1 }}>
<GiftedChat
messages={this.state.messages}
onSend={this.onSend}
user={{
_id: 1
}}
forceGetKeyboardHeight
/>
<KeyboardAvoidingView behavior="padding" keyboardVerticalOffset={80} />
</View>
And this is what I mean:


CC: @xcarpentier
@watadarkstar that because you put forceGetKeyboardHeight on your code..
I also have that line before but its working well when not use that.
@akulah91 THANK YOU that worked! Life saver!
@watadarkstar most welcome..
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. 馃憤
The code works fine but it adds a padding on iOS, so we have to check which Plaform the app is running, my fix was 馃憞馃従
<View style={{ flex: 1 }}>
<GiftedChat
messages={this.state.messages}
onSend={this.onSend}
user={{
_id: 1
}}
/>
<KeyboardAvoidingView behavior={ Platform.OS === 'android' ? 'padding' : null} keyboardVerticalOffset={80} />
</View>
Its not working for me. I tried using KeyboardAvoidingView but still keyboard overlaps the text input
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Why use 80 ? I must use 190 so that it is clearly visible, Is there not a value that is noted for any device?
Why use 80 ? I must use 190 so that it is clearly visible, Is there not a value that is noted for any device?
yes my friend, i use 150
I use it like this, seems responsive....
<KeyboardAvoidingView style={{flex: 1}} behavior={"padding"}
keyboardVerticalOffset={Header.HEIGHT + StatusBar.currentHeight} enabled={Platform.OS === 'android'} >
<GiftedChat
messages={messages}
onSend={newMessages => onSend(newMessages)}
user=
{{
_id: 1,
}}
inverted={false}
/>
</KeyboardAvoidingView>
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. 馃憤
thanks, worked form the first
forceGetKeyboardHeight will move messgeArray up
Most helpful comment
I got it.. Just do like this..
need to declare flex to parent view to make it works. 馃憤