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

'scrollingComplete' callback doesn't trigger reliably #39

Closed
arm1n opened this issue Jun 14, 2013 · 1 comment · Fixed by #47
Closed

'scrollingComplete' callback doesn't trigger reliably #39

arm1n opened this issue Jun 14, 2013 · 1 comment · Fixed by #47

Comments

@arm1n
Copy link

arm1n commented Jun 14, 2013

Hi guys,

I am using the latest version of Zynga Scroller with the new 'scrollingComplete' callback, which is really useful for locking/unlocking f.e. animations to preserve performance (mostly on android devices). Unfortunately, I've noticed that the event doesn't always trigger. After doing some research on this topic I've found that the following code fails (#990):

if (self.__interruptedAnimation || self.__isDragging) {
    self.options.scrollingComplete();
}

Both self.__interruptedAnimation and self.__isDragging are set to false when bug occurs, consequently the self.options.scrollingComplete doesn't get called.

Steps to reproduce:

  1. setup a scroller with the following option: { scrollingComplete: function(){ console.log('complete'); } }
  2. scroll a small amount of content
  3. wait a little before releasing when scrolled (so that no decelaration gets applied and the code runs into if (!self.__isDecelerating){ ... })
  4. the log shouldn't output the 'complete'

You may have to try several times, the bug doesn't always reveal.
This was tested on an iPhone 4S running iOS 6.1.3 in mobile safari.

@kanongil
Copy link
Contributor

kanongil commented Jan 9, 2014

I encountered the same issue and have submitted a pull request that should fix it.

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 a pull request may close this issue.

2 participants