-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[iOS/iPadOS] - FlatList
refresh handling broken/dysfunctional
#36173
Comments
I was unable to reproduce despite following the steps. Tested on iPhone 13, iOS 15.2. |
@carlosalmonte04 Did you enable the new architecture, Fabric and Hermes and build the application afterwards? |
I did the steps below
onRefresh got called every single time. Let me know if you'd like me to try a different way. |
@carlosalmonte04 As stated in the main description of the issue, the problem is related to the You have to modify your fifth step to enable the new architecture and its corresponding parts. Instead of Now you should be able to reproduce and perceive the bug. Please let me know if that has worked for you. |
Yes, that worked for me after using |
I'm adding a few breakpoints on the native side to see if I find something. Also, adding a custom refreshControl component completely disables the onRefresh callback. Pulled down to refresh multiple times after adding the simple custom refreshControl component and |
Might need to update designs temporarily to have a refresh button instead of pull-to-refresh. Or have a SectionList for the second list. Both approaches are disappointing but I can't remember the solution last time I experience this issue, I remember it had to do with styling issues. <SectionList
horizontal
sections={[
{
data: [1, 2, 3],
renderItem: item => (
<FlatList
contentContainerStyle={{
backgroundColor: bgColor[item.item],
}}
data={data}
renderItem={() => (
<View style={{width: 100}}>
<GenericListItem />
</View>
)}
/>
),
},
]}
refreshing={false}
onRefresh={() => console.log('List #2 refresh is called')}
renderItem={GenericListItem}
/>
</> 👎 |
@carlosalmonte04 Thanks for looking into this and providing a possible workaround. However, as you mentioned, those approaches are disappointing and unsatisfactory. I am not quite aware of how the responsibilities are divided in Maybe @cortinico or would you mind delegating? Thanks! |
Again I kindly ask that someone from the core or new architecture team of |
@coolersham did you end up finding a way to solve this? |
@carlosalmonte04 Sadly, I have not found a way to solve this particular broken feature. However, at this point, I am pretty confused and a little bit disappointed by the way the Facebook/React Native team is handling issues. Looking at the sheer number of open issues my hopes are low that we will receive an answer on this one soon. I am well aware that there are probably more important things to focus on, but as mentioned before, even a short answer would be sufficient to let us know the next steps. |
@coolersham we receive hundreds of issues every day and sadly our team is really small. We're trying to do our best to look at all of them and provide answers. I've looked at your issue and sadly I don't have relevant context/suggestions to share at this stage. |
Thank you @cortinico, I totally understand your situation! Alright. So will this ever be analysed in detail or does the community have to wait, whether this issue may be fixed over time or figure it out by themselves and create a PR for it? |
@coolersham having a reproducer project would be a first step to make investigation easier for us and also for folks in the community. You can use this template: https://github.com/react-native-community/reproducer-react-native If someone from the community is willing to investigate and fix this, we'll be more than happy to review & merge the PR |
@cortinico I already provided the code needed to experience this bug in my initial issue description and provided all other necessary information. As you can perceive in the timeline of this issue, the bug got already confirmed by @carlosalmonte04. If it would remove the little overhead needed to experience that bug, I could also create a reproduction repo and share it here. |
Please do 🙏 That would also help others which wish to investigate this |
@cortinico Here is the repository that reproduces this bug in the latest version of |
Any update on this? |
@Alecattie As no one commented here or linked a PR since I provided the reproduction repo - the answer is no. |
Almost seven months have passed since I opened this issue. Five months ago I provided a simple repro so this issue can be further investigated and fixed. Since then, nothing has happened from the maintainer or community side, except a quick fix in another issue, targeting the same problem #37308, which sadly brings along negative side effects and does not work in various scenarios either. Has anyone found a viable solution that can be merged, or do we need to live without this expected standard from now on? |
Just upgraded the provided reproducer to the latest version of |
I'm also having this problem with the latest react-native version 😞 |
This is still a problem on 0.73.6 on New Architecture. As is italic fonts are no longer italic and modals flashing when modal dismiss (but not if pressing Cancel button). |
Hi there, Sorry for the long silence, but as @cortinico mentioned above, we receive tons of issues, the team is small and we need to prioritize ruthlessly. I'll start looking in to the issue today and for the next few days. Thanks @coolersham for the reproducer, I'll try to keep you all updated on the progress.
☝️ this is caused by the reproducers that sets the |
Summary: This change properly recycles the RCTPullToRefreshViewComponentView so that it fixes some misbehaviors of the UIRefreshControl in OSS. This should fix facebook#37308 and facebook#36173 ## Changelog: [iOS][Fixed] - Properly recycle the RCTPullToRefreshViewComponentView Differential Revision: D56018924
Summary: This change properly recycles the RCTPullToRefreshViewComponentView so that it fixes some misbehaviors of the UIRefreshControl in OSS. This should fix facebook#37308 and facebook#36173 ## Changelog: [iOS][Fixed] - Properly recycle the RCTPullToRefreshViewComponentView Differential Revision: D56018924
We found the cause of the issue, and it was because the RCTPullToRefreshViewComponentView was not recycled correctly. What happened is that the UIRefreshControl was not deallocated and remained assigned to a disposed ScrollView. By properly recreating it in prepare for recycle, we fixed the bug. |
Summary: Pull Request resolved: #44047 This change properly recycles the RCTPullToRefreshViewComponentView so that it fixes some misbehaviors of the UIRefreshControl in OSS. This should fix #37308 and #36173 ## Changelog: [iOS][Fixed] - Properly recycle the RCTPullToRefreshViewComponentView Reviewed By: sammy-SC Differential Revision: D56018924 fbshipit-source-id: 3c71328aa0f6fb2a98a19593f0f06419e04e9cae
Description
Description
Since upgrading to the new architecture it seems like the refresh/pull-to-refresh feature of the
FlatList
is broken/not fully functional any longer. However, this is only the case if you place anotherFlatList
ORScrollView
in the same view. Placing just a list in each view does not lead to problems.Pulling down and refreshing works twice before being dysfunctional. Eventually, after a certain pattern, the functionality works again twice and then breaks again.
The sample code provided below works as intended on the old architecture.
Version
0.71.3
Output of
npx react-native info
Not relevant for this issue.
Steps to reproduce
react-native
project with the help of the CLI, install all dependencies and pods and build the application on a iOS/iPadOS device.App.tsx
fileSwitch
button to unmount the current view and mount another one containing twoFlatList
components and aScrollView
(for demonstration purposes).FlatList
(orange one) and once again use theSwitch
buttononRefresh
handler is not calledSnack, code example, screenshot, or link to a repository
https://github.com/coolersham/NRNA-flatlist-reload-bug
The text was updated successfully, but these errors were encountered: