React-native-gifted-chat: "Type message.."Input is behind keyboard

Created on 9 Jun 2018  路  5Comments  路  Source: FaridSafi/react-native-gifted-chat

Issue Description

"Type message.."Input is behind keyboard
you cant see what your typing until u remove keyboard.

Steps to Reproduce / Code Snippets

I opened the project with expo and tried to type

Expected Results

Input Textbox should be above keyboard on focus so you can see what you are typing.
[FILL THIS OUT]

Additional Information

  • Nodejs version: [FILL THIS OUT]
  • React version: [FILL THIS OUT]
  • React Native version: [FILL THIS OUT]
  • react-native-gifted-chat version: [FILL THIS OUT]
  • Platform(s) (iOS, Android, or both?): [FILL THIS OUT]
    whatsapp image 2018-06-10 at 23 43 25

Most helpful comment

After investigation i learned this issue only happens with expo.
I found a fix on a previous post #461

import React, { Component } from 'react';
import { View, Platform } from 'react-native';
import KeyboardSpacer from 'react-native-keyboard-spacer';
import { GiftedChat } from 'react-native-gifted-chat';

export default class Chat extends Component {
  render() {
    const giftedChatMessages = [
      ...
    ];
    return (
      <View style={{flex: 1}}>
        <GiftedChat
          messages={giftedChatMessages}
          onSend={newMessages => onSend(newMessages[0].text)}
          user={{
              _id: 1,
          }}
          renderAvatar={() => null}
        />
        {Platform.OS === 'android' ? <KeyboardSpacer /> : null }
      </View>   
    )
  }
}

All 5 comments

After investigation i learned this issue only happens with expo.
I found a fix on a previous post #461

import React, { Component } from 'react';
import { View, Platform } from 'react-native';
import KeyboardSpacer from 'react-native-keyboard-spacer';
import { GiftedChat } from 'react-native-gifted-chat';

export default class Chat extends Component {
  render() {
    const giftedChatMessages = [
      ...
    ];
    return (
      <View style={{flex: 1}}>
        <GiftedChat
          messages={giftedChatMessages}
          onSend={newMessages => onSend(newMessages[0].text)}
          user={{
              _id: 1,
          }}
          renderAvatar={() => null}
        />
        {Platform.OS === 'android' ? <KeyboardSpacer /> : null }
      </View>   
    )
  }
}

Thanks.

Thank You!

Thanks @alfizo !

Thanks! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hayko1994 picture Hayko1994  路  3Comments

Fr33maan picture Fr33maan  路  3Comments

pentarex picture pentarex  路  3Comments

arayaryoma picture arayaryoma  路  3Comments

cassioseffrin picture cassioseffrin  路  3Comments