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.

[iOS] If you scroll fast to the top onLoadEarlier is not invoked

See original GitHub issue

Issue Description

If you scroll to the top slowly all works good but if you scroll very fast then onLoadEarlier is not invoked

Steps to Reproduce / Code Snippets

<GiftedChat messages={mapMessages(messages)} loadEarlier onLoadEarlier={loadMoreMessages} renderLoadEarlier={() => { return isLoadingEarlier ? ( <View style={{ marginBottom: 20, marginTop: 10 }}> <ActivityIndicator /> </View> ) : null; }} infiniteScroll

Expected Results

onLoadEarlier should be invoked

Additional Information

  • Nodejs version: v14.15.4
  • 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?): iOS 14.4.2
  • TypeScript version: no typescript

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

9reactions
kalekcommented, May 11, 2021

Yes I used listViewProps

` <GiftedChat messages={this.state.messages} listViewProps={{ scrollEventThrottle: 400, onScroll: ({ nativeEvent }) => { if (this.isCloseToTop(nativeEvent)) { this.setState({refreshing: true}); this.loadMoreChat(); } } }} onSend={messages => this.onSend(messages)} user={{ _id: 2, }} />

isCloseToTop({ layoutMeasurement, contentOffset, contentSize }) { const paddingToTop = 80; return contentSize.height - layoutMeasurement.height - paddingToTop <= contentOffset.y; } `

0reactions
stale[bot]commented, Apr 17, 2022

Sorry, but this issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. BTW Thank you for your contributions 😀 !!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

UITextView.scrollRangeToVisible() … | Apple Developer Forums
I 'm looking for a workaround to do the simplest thing in the world: scroll the damn textView to the bottom. iOS.
Read more >
@cookiespam/react-native-gifted-chat - npm
infiniteScroll (Bool) - infinite scroll up when reach the top of messages container, automatically call onLoadEarlier function if exist (not yet ...
Read more >
UITextView is not scrolled to top when loaded - Stack Overflow
I can still scroll it with my finger once its loaded. EDIT I found that removing the auto layout constraints and then fixing...
Read more >
github.com-FaridSafi-react-native-gifted-chat_-_2021-10 ...
infiniteScroll (Bool) - infinite scroll up when reach the top of messages container, automatically call onLoadEarlier function if exist (not yet ...
Read more >
Quickly scroll to the top or bottom of the page - iPhone Hacks
Being able to quickly scroll to the top of the apps by tapping on the status bar is nice, but what if you...
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