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

fix(parallax): scrollTo gets correct scroll value #1455

Merged
merged 1 commit into from
Apr 24, 2021

Conversation

kindoflew
Copy link
Collaborator

Why

Resolves #1454. Parallax will now animate scrollTo correctly.

What

Changed the destructuring of the value of controller in onChange.

I also added a line at 212 to set the controller's value to state.current before animating because otherwise it started with stale state (In the current version state.current will cause the controller to always start at the number from the previous call to scrollTo).

Checklist

  • Documentation updated: n/a
  • Demo added: n/a
  • Ready to be merged

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@joshuaellis
Copy link
Member

Would me looking at one of the demos be a good way of testing this change? If so which one?

@kindoflew
Copy link
Collaborator Author

kindoflew commented Apr 23, 2021

Yes, parallax-vert. The horizontal one still looks weird (PR for that is next).

Copy link
Member

@joshuaellis joshuaellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix, thank you!

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 this pull request may close these issues.

Parallax: scrollTo not executing correctly
2 participants