Skip to content
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

Shouldn't fire when scrolled up from bottom #10

Open
neurofuzzy opened this issue Mar 7, 2013 · 7 comments
Open

Shouldn't fire when scrolled up from bottom #10

neurofuzzy opened this issue Mar 7, 2013 · 7 comments

Comments

@neurofuzzy
Copy link

Hook should really only fire the reload when you're already at the top and try to scroll up. Not sure if you can detect that on all browsers but it works in OS X Chrome.

@fantattitude
Copy link

Yes, at the moment it's not very useful.

@cwacht
Copy link

cwacht commented Mar 8, 2013

Agreed. Preventing unintentional refreshes would be a fantastic feature addition.

@jordansinger
Copy link
Owner

I like the idea. But think about this in a real situation (I have no obligation against this idea): You are saying that when you are already at the top and try to scroll up, it refreshes. I think that would conflict with scrolling to the top if you were say half-way down the page, and scroll to the top. Think about it, when you scroll to the top you aren't going to react quickly enough to stop scrolling and stop the initiation of the refresh. Again, great idea, we just need to combine our heads and think of a unique way to tackle this subject.

@knightdr
Copy link

knightdr commented Mar 9, 2013

@jordansinger,

My guess is that scroll detection alone won't work. I think you'd have to do a combination of mouse drag and scroll events. OSX Webkit allows over scroll so it returns negative values but every other browser does not. That's where mouse drag would fill in the gap. If you've continued to drag 40px(or some value) while scrollTop is 0 show pull to refresh indicator.

@knightdr
Copy link

knightdr commented Mar 9, 2013

@jordansinger,

Oh and maybe mouse wheel as well. That's a lot of events to track so performance maybe/will an issue. If I have extra time, I'll see if this technique works at all in the browser.

Good luck

@cwacht
Copy link

cwacht commented Mar 9, 2013

Also touch events. I imagine Hook.js would really shine on touch devices where people are used to this method of refreshing.

@stryju
Copy link

stryju commented Apr 4, 2013

found a way to differentiate the two events.
quick demo:

http://jsbin.com/ewadin/1/

would you care for a "fix" + pull request?

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

No branches or pull requests

6 participants