Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help Wanted] ListView OnEndReached #16876

Closed
HyperSimon opened this issue Nov 18, 2017 · 3 comments
Closed

[Help Wanted] ListView OnEndReached #16876

HyperSimon opened this issue Nov 18, 2017 · 3 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@HyperSimon
Copy link

HyperSimon commented Nov 18, 2017

Is this a bug report?

I am not sure

Have you read the Contributing Guidelines?

Yes

Environment

Steps to Reproduce

1.Load the first page
2.Simulate a weak network status (such as shutting down the network)
3.Sliding to the ListView triggers loading more locations
4.Swipe to the top of listview
5.Connect to the network
6.Swipe to load more positions

Expected Behavior

Load the second page of data

Actual Behavior

Load more interfaces without callbacks

Reproducible Demo

I actually looked at the Flatlist source code and found this method below,
and I want to know why the current list height should be judged when loading more.
How do I load more data after the network back to normal?

  _maybeCallOnEndReached: function(event?: Object) {
    if (
      this.props.onEndReached &&
      this.scrollProperties.contentLength !== this._sentEndForContentLength &&
      this._getDistanceFromEnd(this.scrollProperties) <
        this.props.onEndReachedThreshold &&
      this.state.curRenderedRowsCount ===
        (this.props.enableEmptySections
          ? this.props.dataSource.getRowAndSectionCount()
          : this.props.dataSource.getRowCount())
    ) {
      this._sentEndForContentLength = this.scrollProperties.contentLength;
      this.props.onEndReached(event);
      return true;
    }
    return false;
  },

(Paste the link to an example project and exact instructions to reproduce the issue.)

@timwangdev
Copy link
Contributor

timwangdev commented Nov 30, 2017

I'm facing the same problem and there is already one issue. Let's keep the discussion in #15356.

@timwangdev
Copy link
Contributor

@facebook-github-bot duplicate #15356

@facebook-github-bot
Copy link
Contributor

Duplicate of #15356

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Nov 30, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Nov 30, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Nov 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants