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.

InputToolBar spacing on iPhoneX

See original GitHub issue

Issue Description

There is an issue with iPhoneX where you either have the message that you are typing overlap with the bottom bar and can’t see all of your text, or if you add a marginBottom you overlap with the avatar from the most recent message.

Here is some text entered into the text box: simulator screen shot - iphone x - 2018-05-26 at 14 33 07

If you add one more character you get this strange artifact: simulator screen shot - iphone x - 2018-05-26 at 14 33 09

If you style the input toolbar then it overlaps the Initials Avatar of the last message: simulator screen shot - iphone x - 2018-05-26 at 14 33 55

Steps to Reproduce / Code Snippets

Default inputToolbar code:

  renderInputToolbar(props) {
    return <InputToolbar {...props} containerStyle={styles.inputToolbarStyle} />;
  }

Here is the styling:

inputToolbarStyle: {
    marginLeft: 15,
    marginRight: 15,
    marginBottom: 10,
    borderWidth: StyleSheet.hairlineWidth,
    borderColor: CommonStyles.colors.middleGrey,
    borderRadius: 25
  },

Expected Results

Should be able to add some padding below the avatar or at least line up the bottom of the avatar with the bottom of the last message

Additional Information

  • Nodejs version: 9.3.0
  • React version: 16.3.1
  • React Native version: Expo version 27
  • react-native-gifted-chat version: 0.4.3
  • Platform(s) (iOS, Android, or both?): Both

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

12reactions
ancequecommented, Aug 9, 2018

@ewal and what to do when you have it inside of SafeAreaView? it created some nasty bottom spacing when the keyboard is open 😦

OK, i found out you can use bottomOffset and offset the chat by the height of bottom safeArea… nice 😃

7reactions
diamont1001commented, May 9, 2019

@msqar

Solved it by setting bottomOffset and react-native-iphone-x-helper.getBottomSpace

like this:

import {getBottomSpace} from 'react-native-iphone-x-helper';

<View style={paddingBottom: getBottomSpace()}>
...
  <GiftedChat
    messages={this.state.messages}
    bottomOffset={getBottomSpace()}
    onSend={messages => this.onSend(messages)}
    user={{
      _id: 1,
    }}
  />
</View>
Read more comments on GitHub >

github_iconTop Results From Across the Web

jsqmessagesviewcontroller inputToolBar IOS 11 iphone X Swift4
I'm currently working on the solution I gave in that answer, as it did not solve all problems, and the new approach possibly...
Read more >
Toolbars - Menus and actions - Human Interface Guidelines
A toolbar automatically adopts translucency when placed above a scroll view or when the window is configured as a full-size content view.
Read more >
jsqmessagesviewcontroller inputToolBar IOS 11 iphone X ...
Open JSQMessagesViewController.xib; Click File Inspector and choose "Use safe area layout guides"; Change deployment target of JSQMessagesViewController to 9.0 ...
Read more >
Apple - Preowned iPhone X 64GB (Unlocked) - Space Gray
Shop Apple Preowned iPhone X 64GB (Unlocked) Space Gray at Best Buy. Find low everyday prices and buy online for delivery or in-store...
Read more >
iPhone X Owners Complain About Keyboard's 'Wasted Space'
The iOS keyboard on iPhone X. On the new keyboard, the Globe or Emoji icon and the Dictation icon both sit below the...
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