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

Smooth scroll not working when switching to a different route and back again. #120

Closed
charliedavison opened this issue Aug 8, 2016 · 3 comments

Comments

@charliedavison
Copy link

charliedavison commented Aug 8, 2016

I have an application where react router loads a wrapper component, which in turn contains a component with react-scroll elements and links. This appears to work perfectly, however when I switch routes and then come back suddenly smooth scrolling no longer works when clicking on the links despite the "begin" and "end" events both being fired, and seemingly the correct parameters being passed around when I step through everything up to the point of "RequestAnimationFrameHelper".

If I turn smooth scroll off, the scroll bar is moved to the correct place(obviously without the animation).

I have tried in several browsers and it doesn't seem to be a browser specific issue - has anyone run into anything similar?

@fisshy
Copy link
Owner

fisshy commented Aug 9, 2016

I have not tried react-scroll with react-router ( or any type of routing ). Might be that we remove some listeners in componentWillUnmount. I will take a look at it and hopefully tonight.

@erinmeyers88
Copy link
Contributor

I'm having the same issue here. Very interested in a solution!

@erinmeyers88
Copy link
Contributor

This solution worked for me: #114

@fisshy fisshy closed this as completed Nov 23, 2017
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

No branches or pull requests

3 participants