-
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
RefreshControl still is showing even the value of refreshing is false #5839
Comments
Hey jaynsw, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
I am seeing the same issue |
cc: @janicduplessis |
Could you give me a code sample that reproduces the issue? |
<ScrollView ....
} |
The isLoading when false should dismiss the refresh on the screen? |
Does it work if you call this at the start of your refreshData function this.setState({
isLoading: true
}); |
In your RefreshControl did you set the In the example you linked
|
I had that before sorry. Its working. The actual fix is setting this.setState({ in the refresh. |
Good! This isn't really a bug since the refreshing prop is a controlled prop and is supposed to be set to true at the start of the onRefresh event but I'll see if I can think of a way to warn about this error or make it more obvious because the native RefreshControl will still start refreshing even if the @nicklockwood Any ideas if we can do something about this? |
I met the same problem. The refreshing prop is passed as props by redux. In android, the refreshing control will hide properly but in iOS the refreshing control will remain showing most of the time (it does hide sometimes). Seems to be a bug. |
It doesn't hide with the following code
|
I also met the problem. This is my code: <ListView style={styles.listView}
dataSource={this.state.dataSource}
renderHeader={this.renderHeader}
renderRow={this.renderRow.bind(this)}
refreshControl={<RefreshControl
refreshing={this.state.isRefreshing}
onRefresh={this._onRefresh.bind(this)}
tintColor="#FF4946"
title="Loading..." /> }
/> _onRefresh() {
this.setState({isRefreshing: true});
setTimeout(()=>{
this.setState({
isRefreshing: false,
});
}, 1000);
} |
Seeing the same problem here, also passing a refreshing prop via redux. Interestingly it only seems to happen only every second time the dataSource changes, the other times it is okay, but that may just be my setup. Android is fine |
Could someone provide a code sample or a link to rnplay that reproduce the bug so I can look into it? |
@janicduplessis my problem solved. My shouldComponentUpdate prevented the RefreshControl from being updated. Thank you anyway. |
In RN 0.22.2 the problem still occurs, but less often. |
@janicduplessis, I met the same problem, and found there is a 0.25s animation after change refreshing status in "RCTRefreshControl.m". If i change the refreshing value by JS during the time. The refreshing of props will inconsistencies with Object-C. This is a test code. On my device,after the state change to false ,the control still is refreshing. you can change interval time and count.
|
I can verify that there's a race condition somewhere in there that can leave the |
Yea, I see why it happens, I'll work on a fix. |
Any updates @janicduplessis? This seems to still be happening in 0.24. |
I'm still seeing this problem in rn 0.26.3 I've got the render method logging the value of |
I'm seeing the same problem in rn 0.27.2. |
I'm seeing the same problem in rn 0.28.0, as following figure shown, the RefreshControl will disappear when i touch the ListView. Below is my codes.
|
I see this on 0.28.0 also. Depending on your app's design, you might be able to work around the issue by setting a background on your
|
@imoreapps did you fix it? I have the same bug and can't find any solutions( |
@Darwinium I always use the InteractionManager.runAfterInteractions to wrap the data reload/fetch actions.
|
I met the same problem, this helps. |
I also came across this issue on 0.28.0. Has this been fixed in later versions? |
Facing the same issue on 0.29.2 , any fixes on this so far, or any work arounds? |
It seemed that RN 0.34 fixed this issue. |
The issue that @imoreapps was facing @@was not fixed for me in v0.35.0. To get around the issue I set the backgroundColor of a child component to the ScrollView |
For those who are still facing the issue, you can wrap up your onRefresh content with InteractionManager like below:
|
Definitely still an issue. If I set the refreshing prop to false from outside the onRefresh method, say... somewhere else in the UI that triggers a refresh, the RefreshControl doesn't do anything with that updated prop, just stays spinning. |
the same problem in 0.42 version in official example https://facebook.github.io/react-native/docs/refreshcontrol.html. Always spinning http://i.prntscr.com/39354445e5fd4ab38021894f898c9156.png |
same problem in 0.44 |
Why was this issue closed? I'm running on 0.48, and I'm still seeing the issue. I'm using a redux prop to determine if the list is refreshing:
Even if the For me, this only happens in conjunction with infinite scroll. If I scroll down the list and it fetches more items, and then back to the top, the pull-to-refresh animation is still going despite the It only happens on iOS |
I also don't understand why this got closed. I'm also facing the same issue as @jhalborg when using a redux props. My props is clearly false and the spinning is still showing up. |
@jhalborg the only solution I've found for now is to move to refresh props to the internal state of the page. Then I set it to true when calling the refresh function, and added a timeout to set it to false after a few seconds. This is a terrible solution, and it's really weird that the FlatList does not work well with the redux state directly. |
0.0I am facing the same issue, after debug, I find this : And the logs like this :
Source code :
So, is there a bug of iPhone X schedule I can't produce this issue ENV :OSX : 10.13 |
Still present in 0.50+ for me. I awaited any new developments on this issue, but it seems dead so I've resorted to some hacking. All of the proposed solutions (problem with changing loading state faster than 250 ms, using InteractionManager etc) seemed to point towards the same thing, that the refreshcontrol (still) cannot handle too fast changes. From my experiments, that still seems to be the case. My
After some experimenting with values for I hope it helps someone, and that the issue might be fixed in core at some point. Tagging @janicduplessis - I appreciate the effort you've done already, but for some reason the fix is still buggy - can't tell you why, unfortunately :-/ Let me know if you need more code, but it's a very standard redux setup
Merry christmas and happy new year to you all from the past! :) |
I'm sorry to notify all of you but thank you a lot @jhalborg ! |
Is this worth re-opening? Delaying incoming prop updates by a certain timeout does not seem like a stable, scalable, nor reliable solution. |
Why has this issue been closed? There still is no reliable solution for this. I guess a lot of us use a prop "loading" via redux and use this prop within many screens. Unfortunately, with React Native 0.49.5 I am still facing this problem 😧 |
It seems fixed after added
For postinstall script:
The reason is |
version: 0.19.0
ListView refreshControl
IOS9.2
When Pulling down the listview items, the onRefresh is triggered properly with the 'indicator', but the indicator doesn't hide when the refreshing property was changed to 'false'
The text was updated successfully, but these errors were encountered: