When opening chat auto-scrolling to bottom doesn't reach last message
See original GitHub issueIssue 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:
- Created 3 years ago
- Reactions:6
- Comments:8 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also encountered this problem,it seems like you should change the inverted={false} to inverted={true} to make it work
having the same problem on iOS