Skip to content
New issue

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

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

Already on GitHub? # to your account

load more items function gets called before user scrolls to bottom when scrollbar is not a parent of flatlist #103

Closed
nikhilgoswami opened this issue Jul 1, 2023 · 1 comment · May be fixed by #104
Assignees
Labels

Comments

@nikhilgoswami
Copy link

Is your feature request related to a problem? Please describe.
load more items function gets called before user scrolls to bottom when scrollbar is not a parent of flatlist

Describe the solution you'd like
Option to pass id of scrollbar container if it is not the direct parent of flatlist

Additional context
Sometimes it is not possible to add scrollbar as a parent to flatlist in these cases we need a option to pass id or class of scrollbar container so that flatlist knows it is not a direct parent of container

@ECorreia45 ECorreia45 self-assigned this Jul 1, 2023
@ECorreia45 ECorreia45 linked a pull request Jul 1, 2023 that will close this issue
@ECorreia45
Copy link
Collaborator

try the new scrollingContainerId prop it by running npm i flatlist-react@next. It is not yet released

PR for more details -> #104

Example:

// as a DEEP child of a scrolling ancestor element using the "scrollingContainerId" prop
<div style={{overflow: "auto", height: "300px"}} id="scrolling-container">
  <div className="mid-wrapper">
    <div className="list-wrapper">
      <FlatList
        list={this.props.people}
        renderItem={this.renderPerson}
        renderWhenEmpty={this.showBlank}
        scrollingContainerId="scrolling-container"
      />
    </div>
  </div>
</div>

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants