iscroll icon indicating copy to clipboard operation
iscroll copied to clipboard

Jumpy behavior in Chrome, FF, Safari if scroller div is shorter than wrapper div

Open mason-stewart opened this issue 15 years ago • 6 comments

If the contents of the scroller div are not tall enough to stretch it to a greater height than the wrapper div, you'll see mega-jumpy behavior in latest Chrome, FF and Safari builds. The list (or whatever it is you're trying to scroll) will jump up and down wildly if scrolling down. Scrolling up poses no problems.

In my circumstance, I was able to patch it with

_startAni: function () {
    // immediately after variable delcaraitons
    if (that.wrapper.offsetHeight > that.wrapper.children[0].offsetHeight) return;

but I imagine that this isn't appropriate for everyone. I'll be happy to make this a param in the options and submit a Pull Request, unless you think there's a more elegant solution. Thanks!

mason-stewart avatar Oct 16 '11 16:10 mason-stewart

Are you testing the latest version? I can't replicate this issue.

cubiq avatar Oct 16 '11 16:10 cubiq

I'm able to replicate it, even on the iScroll demo at http://cubiq.org/dropbox/iscroll4/examples/simple/ .

Here's a video I made of it: http://screencast.com/t/3TTZaGHBTk . It's actually jumping much more rapidly than that, but the low frame rate couldn't capture it.

I was able to create this situation by opening Chrome's WebKit Inspector and deleting enough of the <li> elements so that the <ul> was shorter than the viewport. Then simply scroll down. The same situation is happening with the most recent iScroll.js in a backbone.js app I'm working on. Thanks!

mason-stewart avatar Oct 16 '11 23:10 mason-stewart

You have to call refresh() method if you remove LIs from the inspector

cubiq avatar Oct 17 '11 07:10 cubiq

video http://cubiq.org/dropbox/chrome-test.mov

cubiq avatar Oct 17 '11 07:10 cubiq

Hey Matteo, I failed to mention that I'm experiencing this with a trackpad on a new MacBook Air.

I repeated the steps in your video, and still experienced the problem on the iScroll demo. My backbone app is also calling refresh() automatically after loading in list items, and the same behavior is occurring there.

Any ideas?

mason-stewart avatar Oct 17 '11 18:10 mason-stewart

v4 or earlier is unsupported. Please check out v5 if you have this issue.

There are some trackpad issues with iScroll 5 as well, currently, but we are working on improving that.

davidpfahler avatar Dec 22 '13 13:12 davidpfahler