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.

When opening chat auto-scrolling to bottom doesn't reach last message

See original GitHub issue

Issue Description

When I open a conversation and there are messages, the auto scroll to the bottom of the chat doesn’t always reach the last message. For example if there are 25 messages in the chat, the scrolling will scroll to message number 19. If there are 42 messages in the chat, the scrolling only reaches message 39. I’ve noticed the pattern where the scrolling reaches the last index of the previous 10th. e.g 19/25, 29/38, 39/42 etc.

In my case most recent messages are shown at the bottom of the chat and older messages at the top. I expect the chat to scroll to the most recent message all the way down.

Steps to Reproduce / Code Snippets

Implemented GiftedChat according to the docs.

<GiftedChat
      alignTop
      inverted={false}
      messages={props.messages}
      onSend={messages => onSend(messages)}
      user={{_id: user.uid, name: user.firstName, avatar: user.displayPicture}}
      showUserAvatar
      renderBubble={(message) => renderMessageBubble(message)}
      shouldUpdateMessage={(message) => renderMessageBubble(message)}
      isAnimated
      audio={true}
      minComposerHeight={46}
      renderInputToolbar={renderChatInput}
    />

Expected Results

Chat should always scroll to the bottom of the messages with the last message rendering at the bottom.

Additional Information

  • React Native version: 0.62.2
  • react-native-gifted-chat version: 0.16.3
  • Platform(s) (iOS, Android, or both?): iOS

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
SNEAndycommented, Sep 6, 2021

I also encountered this problem,it seems like you should change the inverted={false} to inverted={true} to make it work

1reaction
ethanyuwangcommented, Feb 17, 2021

having the same problem on iOS

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scroll to bottom when new message added - Stack Overflow
I want to scroll to the bottom of the chat box when a new input is given by the user or the Data...
Read more >
Conversation window doesn't auto scroll to display new ...
It seems that in an existing open window containing multiple conversations (indicated by the different 'tabs' on the left side), when a new ......
Read more >
Conversation Log doesn't scroll to the bottom when new ...
If a Conversation Log is already scrolled to the bottom, but isn't focused when new chat messages arrive, it will not scroll as...
Read more >
Google chat in gmail + safari = no autoscrolling new messages
I'm using Safari 15.4 on latest MacBook. When I have a little chat window on the right bottom side of my inbox and...
Read more >
Option to Automatically Scroll Down to the Bottom of a chat.
An option to scroll all the way down would be beneficial because it would save me having to scroll down 50 messages when...
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