gabergg / react-scrollable-anchor

Smooth scrolling anchors bound to URL hash
MIT License
291 stars 90 forks source link

Issues when scrolling down with mouse #67

Closed gotplitz closed 1 year ago

gotplitz commented 5 years ago

Hi, I have an odd issue. When I use the button it works perfectly, but some people may still try to use the scroll down with the mouse, so I try it and when I do it with the mouse it takes me to the top again.

I've seen in the address bar I have https://localhost:3000 and when I'm scrolling down I have https://localhost:300/#section04 but the hashtag disappear automatically and therefore the page scrolls up automatically.

What can I do?

adstr123 commented 5 years ago

I have this exact issue too, I didn't notice the URL changing briefly on scroll until you mentioned it but that happens to me too.

I am using Gatsby 2.3.25 with react 16.8.6.

I don't think this is being actively maintained anymore so I will probably give up on it. I will try this as an alternative: https://github.com/some-react-components/react-scrollchor

gotplitz commented 5 years ago

Hey man. Thanks for the suggestion, I will take a look.

adstr123 commented 5 years ago

For anyone else wondering, I tried it and that package seems to work well. Includes all the functionality (e.g. adding offset, animation timing) of this one, as well as more (pre/post scroll callbacks etc.)

Now I just need to add delay functionality and it's perfect...

polaris218 commented 4 years ago

https://www.npmjs.com/package/react-scroll-to-component This package will be a good alternative.