Scrollstart event fires prematurely #428

Closed
membla opened this Issue Jul 12, 2013 · 11 comments

Projects

None yet

6 participants

@membla
membla commented Jul 12, 2013

I would reckon that the scrollstart event should only fire once an actual movement has begun - as it is now the scrollstart fires immediately on touchstart.

@cubiq
Owner
cubiq commented Jul 12, 2013

we would probably need both events. As of now scrollStart is actually touchStart (not entirely true but still...). In my experiments having an event before the scroll actually initiates is more useful than one that fires once the scroll already started

@brianblakely

The issue at the moment is that taps on an iScroll-enabled pane trigger a scrollStart, which is unexpected.

Maybe there should be a 5px radius before scrollStart fires. This is similar to what I use for my own "tap" event implementation, but in reverse (i.e. if pointer moves more than 5px in any direction, it isn't a tap).

@pasevin
pasevin commented Aug 26, 2013

I second that. I have practical example/problem with this at the moment. On scrollStart I make my top and bottom bars fade out and on scrollEnd fade back in and it works great. Until someone actually just taps on a slider button instead of scrolling whole container. At that moment scrollStart fires and header/footer disappear, but never appear back, cause scrollEnd never fires. It's just logic problem, as you expect it actually start on scroll not tap. So @brianblakely is probably right, there should be some kind of few px tracking before it fires scrollStart, and just touchStart before that.

Sorry for lengthy explanation. Really looking forward to this fix :] Until then back to JQ Mobile "scrollstart"...

@cubiq
Owner
cubiq commented Aug 26, 2013

okay this is very problematic as it is going to break current code. I have to think a nice way of doing it. I probably should keep scrollstart as it is now and add a new event (scrollStartThreashold or something) for when you start moving.

@brianblakely

"okay this is very problematic as it is going to break current code."

Well, it IS a beta, right? :)

@cubiq
Owner
cubiq commented Aug 26, 2013

well, technically we are out of beta

@cemerson

Anyone have a fix or hack for this yet? Really debilitating to not be able to capture the true scroll start event

@cubiq
Owner
cubiq commented Oct 28, 2013

I'll be working on iScroll in the next couple of days. I'll do my best to fix as time permits

@alvaro0555

This is what I do, I don't use 2way scrolling so I dont know how it goes for it. But for vertical and horizontal (even nested) works:

alvaro0555@2867ebd

Hope it helps

@cubiq cubiq added a commit that referenced this issue Oct 29, 2013
@cubiq fix #439 #488 #517 #428 #270 #520 #447 #452 #509 052c5ba
@cubiq
Owner
cubiq commented Oct 29, 2013

scrollStart has become beforeScrollStart, now scrollStart should be initiated when the scrolling actually starts

@cubiq cubiq closed this Oct 29, 2013
@cemerson

Thanks for this fix! Much appreciated!

On Oct 29, 2013, at 7:03 PM, "Matteo Spinelli" <notifications@github.commailto:notifications@github.com> wrote:

scrollStart has become beforeScrollStart, now scrollStart should be initiated when the scrolling actually starts


Reply to this email directly or view it on GitHubhttps://github.com/cubiq/iscroll/issues/428#issuecomment-27352019.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment