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.

[Android] gifted chat scroll sometimes doesn't works

See original GitHub issue

Issue Description

gifted chat’s scroll sometimes doesn’t works only in the Android platform. I found that if I use TouchableWithoutFeedback, scroll doesn’t work properly. It is weird that if I starts scrolling at message bubble or avatar profile(I think it is touchable component), scroll works well. How can I fix it?

I use TouchableWithoutFeedback and KeyboardAvoidingView for chat view adjust keyboard’s size.

Steps to Reproduce / Code Snippets

<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
        <KeyboardAvoidingView
          behavior="padding"
          onStartShouldSetResponder={() => true}
          keyboardVerticalOffset={
            Platform.OS === "ios" ? 0 : -Dimensions.get("window").height
          }
          style={{ flex: 1, backgroundColor: "#000" }}
        >
          <OtherComponents/>
          <GiftedChat
            ref="giftedChat"
            style={{ flex: 9 }}
            messages={this.state.messages}
            onSend={(messages) => this.onSend(messages)}
            renderBubble={this._renderBubble}
            renderTime={this._renderTime}
            renderMessage={this._renderMessage}
            renderSend={this._renderSend}
            renderInputToolbar={this._renderInputToolbar}
            textInputStyle={styles.chatTextInput}
            placeholder="Your messages..."
            isKeyboardInternallyHandled={false}
            scrollToBottom={true}
            onPressAvatar={() =>
              this._openPartnerProfileModal(
                this.props.navigation.getParam("partnerProfildId")
              )
            }
            user={{
              _id: this.state.loginUserId,
              name: "me",
              avatar: "",
            }}
          />
          <OtherComponents/>
        </KeyboardAvoidingView>
      </TouchableWithoutFeedback>

Expected Results

I hope scroll works well in the android platform.

Additional Information

  • Nodejs version: v12.16.1
  • React version: 16.13.1
  • React Native version: 0.63.3
  • react-native-gifted-chat version: ^0.16.3
  • Platform(s) (iOS, Android, or both?): [FILL THIS OUT]
  • TypeScript version: [FILL THIS OUT]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
guigralhocommented, Jul 29, 2021

Hi,

I’m having the same issue here but also on iOS. The screen only scrolls if I start scrolling at message bubble

0reactions
rohank45commented, Aug 29, 2022

Issue Description

gifted chat’s scroll sometimes doesn’t works only in the Android platform. I found that if I use TouchableWithoutFeedback, scroll doesn’t work properly. It is weird that if I starts scrolling at message bubble or avatar profile(I think it is touchable component), scroll works well. How can I fix it?

I use TouchableWithoutFeedback and KeyboardAvoidingView for chat view adjust keyboard’s size.

Steps to Reproduce / Code Snippets

<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
        <KeyboardAvoidingView
          behavior="padding"
          onStartShouldSetResponder={() => true}
          keyboardVerticalOffset={
            Platform.OS === "ios" ? 0 : -Dimensions.get("window").height
          }
          style={{ flex: 1, backgroundColor: "#000" }}
        >
          �<OtherComponents/>
          <GiftedChat
            ref="giftedChat"
            style={{ flex: 9 }}
            messages={this.state.messages}
            onSend={(messages) => this.onSend(messages)}
            renderBubble={this._renderBubble}
            renderTime={this._renderTime}
            renderMessage={this._renderMessage}
            renderSend={this._renderSend}
            renderInputToolbar={this._renderInputToolbar}
            textInputStyle={styles.chatTextInput}
            placeholder="Your messages..."
            isKeyboardInternallyHandled={false}
            scrollToBottom={true}
            onPressAvatar={() =>
              this._openPartnerProfileModal(
                this.props.navigation.getParam("partnerProfildId")
              )
            }
            user={{
              _id: this.state.loginUserId,
              name: "me",
              avatar: "",
            }}
          />
          �<OtherComponents/>
        </KeyboardAvoidingView>
      </TouchableWithoutFeedback>

Expected Results

I hope scroll works well in the android platform.

Additional Information

  • Nodejs version: v12.16.1
  • React version: 16.13.1
  • React Native version: 0.63.3
  • react-native-gifted-chat version: ^0.16.3
  • Platform(s) (iOS, Android, or both?): [FILL THIS OUT]
  • TypeScript version: [FILL THIS OUT]

removed flex:1 it will fix the scrolling issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Giftedchat scroll not working if dragging slow on background
But it doesn't when dragging slowly starting over the background. Am I mising something in the giftedchat props? giftedchat slow drag bug.
Read more >
react-native-gifted-chat - npm
The most complete chat UI for React Native. ... Start using react-native-gifted-chat in your project by running `npm i ...
Read more >
[Update: Dec. 07] YouTube bugs/issues & pending ...
Here we are tracking all the bugs and problems found on YouTube and their status as well as any pending improvements that are...
Read more >
Expo React Native Chat App | iOS and Android ... - YouTube
In this video , we will walk through how to use the firebase to store and fetch the messages. With the help of...
Read more >
FAQ | Animal Crossing: New Horizons (ACNH) (ACNH)
This sometimes happens due to lag, and can especially affect mobile users. Try closing and restarting the app. TRADING. How do I protect...
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