-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
FlatList onRefresh not called on pull up. #14756
Comments
Can you set this up as a Snack? Should be pretty straightforward, no need to make a network request in the refresh call either. |
@hramos Here's a link: https://snack.expo.io/HJYx3Kx4W Issue is that FlatList onRefresh does not work when it is nested inside ScrollView. In the Snack, if you change the ScrollView to View, then it works okay. |
Gotcha, can you update your description at the top to make that clarification? |
updated. |
@sahrens is this intended to work? I'm not sure how prevalent the use of a FlatList within a ScrollView is. |
@hramos @sahrens I'm running into a couple situations where having ScrollView support would be helpful. For example, if I need to detect a scroll event in order to hide the header, according to the FlatList docs this is not possible. Furthermore, if a content filter bar is to be placed above a FlatList, it would be rendered fixed above the scrollable content and take up screen space, an issue that would not otherwise occur when using ScrollView. UPDATE: Just tried attaching onScroll to FlatList. It works; would be nice to see this documented when you guys have a chance. Regarding the header bar, there's a prop that I missed the first time around. I see now that the intent of FlatList is a super ScrollView, and I suppose nesting would be bad design. |
I'm closing this issue as the original problem was caused by bad design / inadequate understanding of FlatList. Better documentation would be helpful though. |
@dmr07 : Could you post your solution/changes here? I too have a situation where I have a fixed header with filter options and a FlatList (which needs pull-to-refresh) within a scroll view. |
Note: I too fixed the problem by using |
Is this a bug report?
Yes
Have you read the Bugs section of the Contributing to React Native Guide?
Yes
Environment
react-native -v
: 0.4.5node -v
: 7.4.0npm -v
: 5.0.3yarn --version
(if you use Yarn): 0.24.5Then, specify:
Steps to Reproduce
<ScrollView>
elementExpected Behavior
Call onRefresh function on pull up.
Actual Behavior
onRefresh function is not called.
Reproducible Demo
Snack Link: https://snack.expo.io/HJYx3Kx4W
The text was updated successfully, but these errors were encountered: