react-native-gifted-chat icon indicating copy to clipboard operation
react-native-gifted-chat copied to clipboard

renderAvatar seems to add a padding

Open benjaminb10 opened this issue 9 years ago • 3 comments

It seems that using renderAvatar add a padding to the last bubble, even if the renderAvatar does nothing more than render the original Avatar.

My code:

  renderAvatar(props) {
    return (
        <Avatar
          {...props}
        />
    );
  }
  render() {
    return (
      <View>
        <GiftedChat
          messages={this.messages}
          renderAvatar={this.renderAvatar.bind(this)}
        />
      </View>
    );
  }

The result before and after commenting the line renderAvatar={this.renderAvatar.bind(this)}:

screenshot_2016-12-15 23 32 21_gxsdxi

screenshot_2016-12-15 23 31 43_jf7ydd

benjaminb10 avatar Dec 15 '16 22:12 benjaminb10

@FaridSafi any news about this issue?

benjaminb10 avatar Dec 27 '16 23:12 benjaminb10

I've found a temporary hack for fixing this: wrapping Avatar component in a View component with a negative margin right of 8.

  renderAvatar(props) {
    return (
      <View style={{'marginRight': -8}}>
        <Avatar
          {...props}
        />
      </View>
    );
  }

benjaminb10 avatar Jan 04 '17 14:01 benjaminb10

How's this closed? @xcarpentier It's still very much happening 5 years later

melyux avatar Jun 02 '24 05:06 melyux