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

scrollRAF must be nulled #202

Closed
satazor opened this issue Dec 5, 2013 · 4 comments
Closed

scrollRAF must be nulled #202

satazor opened this issue Dec 5, 2013 · 4 comments
Labels

Comments

@satazor
Copy link
Contributor

satazor commented Dec 5, 2013

Making .stop() and .reset() causes the scroll slider never to be updated. This is because in the stop method, this.scrollRAF must be nulled.

      if (cAF) {
        cAF(this.scrollRAF);
      }

should be changed to:

      if (cAF) {
        cAF(this.scrollRAF);
        this.scrollRAF = null;
      }

better yet:

      if (this.scrollRAF) {  // only call cAF if really necessary (pending raf)
        cAF(this.scrollRAF);
        this.scrollRAF = null;
      }
@satazor
Copy link
Contributor Author

satazor commented Dec 5, 2013

I could make a PR but the project is written in CS and I never ever wrote in CS, so I could mess things up.

@kristerkari
Copy link
Collaborator

Thanks for reporting this too!

@kristerkari
Copy link
Collaborator

Made a fix. Please test if it works.

@satazor
Copy link
Contributor Author

satazor commented Dec 11, 2013

Works!

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

No branches or pull requests

2 participants