some-react-components / react-scrollchor

A React component for scroll to `#hash` links with smooth animations
ISC License
149 stars 24 forks source link

Not working when I put the component inside a div with overflow: scroll ! #6

Closed tarangdave closed 7 years ago

tarangdave commented 7 years ago

When the entire component is rendered on the browser screen the Scrollchor with #id works, but when the same component is kept in a div with overflow: scroll property in parent div it doesn't work. I had the same issue with react-scroll Link. They mentioned that react-scroll won't work inside a div. Is this the same issue with react-scrollchor?

bySabi commented 7 years ago

Could you share a repo with your issue??

bySabi commented 7 years ago

I´m affraid this will not work cause what is scrolled is the top document container not a individual component or div. This is implemented on top of document.documentElement or document.body scrollTop, a browser use case. See src: https://github.com/bySabi/react-scrollchor/blob/master/src/utils.js#L3

tarangdave commented 7 years ago

Ohk I get it. So in my case what would you suggest? Any other libs, within your knowledge, that would satisfy my purpose.

bySabi commented 7 years ago

Sorry! I don´t know any React package that do that out of box. Never need something like this.

bySabi commented 7 years ago

closed due inactivity