-
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] Flatlist bug: update refreshing prop programmatically #25898
Comments
Also having this issue |
I'm still having this issue, I haven't been able to dig deeper. |
still at 0.60 |
Still happening at 0.60.5
|
Has anybody found a solution for this issue? |
Still happening on 0.61.1
|
Still happening on 0.61.2
|
Has anybody found a solution for this problem? |
Hi, I am on version 0.59.10 and the following around worked for me. Not sure if it would work on the latest react-native version. But you could give it a try :)
<FlatList
data={jobs}
// refreshing={loading}
// onRefresh={onRefresh} Instead DO this
refreshControl={<RefreshControl refreshing={loading} onRefresh={onRefresh} />}
...
)}
/>
|
Workaround: The first render refreshing prop should be false. import React, { memo, useEffect, useMemo, useState } from 'react';
import { RefreshControl as RefreshControlCore, RefreshControlProps } from 'react-native';
const RefreshControl = memo(({ refreshing, ...props }: RefreshControlProps) => {
const [firstRender, setFirstRender] = useState(true);
useEffect(() => {
const timeout = setTimeout(() => setFirstRender(false), 100);
return () => clearTimeout(timeout);
}, []);
return (
<RefreshControlCore
refreshing={firstRender ? false : refreshing}
{...props}
/>
);
});
export default RefreshControl; |
It seems like I've had to come up with some clugy workaround for this issue on iOS every couple of react-native releases and here I am again. None of the solutions above worked for me. You can set the The workaround that works for me is to (again, this is for iOS as android works fine out of the box):
this.flatListRef.scrollToOffset({ offset: -60, animated: false })
this.flatListRef.scrollToOffset({ offset: 0, animated: false }) |
This issue could be resolved on this PR #27236). |
In the case of a FlatList this issue still persists on iOS. Works perfectly on android when using the refreshing and onRefresh props in this way.
|
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
When changing the "refreshing" property programmatically on iOS, the activity indicator doesn't show automatically, the user needs to move the list a little bit down in order to see the activity indicator spinning.
It works perfectly fine on Android.
React Native version:
Steps To Reproduce
Describe what you expected to happen:
By updating the refreshing property programmatically, the list should automatically display the activity indicator.
Snack, code example, screenshot, or link to a repository:
The text was updated successfully, but these errors were encountered: