Skip to content

Fix pull to refresh logic #17

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bogdantmm92
Copy link

This fix contains a fix for this issue: #16
It also keeps the list refreshing until the user is not touching. Without this fix, one could pull & hold and the refresh function would be triggered multiple times.

@bogdantmm92
Copy link
Author

@jsdf could you take a look over this? It contains major improvements in my oppinion.

@jsdf
Copy link
Owner

jsdf commented May 23, 2015

Sorry, I'm a bit busy at the moment so I'll get back to you soon. However from initially looking over it I think I'd probably like to implement a fix in a slightly different way. However I appreciate your bringing theses issues to my attention.

@@ -37,7 +38,16 @@ var ControlledRefreshableListView = React.createClass({
handleScroll(e) {
var scrollY = e.nativeEvent.contentInset.top + e.nativeEvent.contentOffset.y

if (!(this.props.ignoreInertialScroll && this.isTouching)) {
if (scrollY == 0 && this.scrollingUp && !this.isTouching) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 41-48 tells me when the user stops pulling and the scroll goes back to 0. Only then I set isRefreshing to false. Lines 46-48 were necesary because if I update the list while user is pulling, scroll position is set to 0 and then gets back to last position.

@doochik
Copy link

doochik commented Sep 4, 2015

Merge this please, this bug is really annoying me (

@bogdantmm92
Copy link
Author

I switched to https://github.com/Shuangzuan/RCTRefreshControl . It still
has some minor problems but looks & feela better.
On Fri, Sep 4, 2015 at 2:50 PM Aleksei Androsov [email protected]
wrote:

Merge this please, this bug is really annoying me (


Reply to this email directly or view it on GitHub
#17 (comment)
.

@doochik
Copy link

doochik commented Sep 4, 2015

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants