Skip to content

Autoscrolling to new message is not working when inverted is false #2612

Open
@surajbhosale45

Description

@surajbhosale45

When we send/receive any new message its not scrolling to latest message, rather its scrolling to top instead of scrolling to bottom as i given inverted={false}, also when i open chat history it should scroll to bottom.

What changes i need to made in my code?

My code:
<KeyboardAvoidingView
style={{flex: 1}}
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
keyboardVerticalOffset={isKeyboardVisible ? 170 : 0}>
<GiftedChat
messagesContainerStyle={{
backgroundColor: COLORS.GRAY98,
...messagesContainerStyle,
}}
isKeyboardInternallyHandled={false}
keyboardShouldPersistTaps="never"
messages={messages}
inverted={false}
infiniteScroll
isLoadingEarlier
renderAvatarOnTop
renderSend={() => (
<TouchableOpacity
onPress={() => {
onSend();
}}>


)}
user={{
_id: currentUserInfo?.id,
name: ${currentUserInfo?.firstName} ${currentUserInfo?.lastName},
}}
text={inputText}
onInputTextChanged={text => setInputText(text)}
renderBubble={renderCustomBubble}
renderInputToolbar={renderCustomInputToolbar}
placeholder={t('TYPE_MESSAGE')}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions