rafgraph / react-router-hash-link

Hash link scroll functionality for React Router
https://react-router-hash-link.rafgraph.dev
MIT License
732 stars 62 forks source link

Scrolls to bottom of element rather than top in IE11 #30

Closed robatwilliams closed 5 years ago

robatwilliams commented 6 years ago

alignToTop = true is the default: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

It appears that the passing of undefined here is being interpreted as false: https://github.com/rafrex/react-router-hash-link/blob/master/src/index.js#L68

robatwilliams commented 6 years ago

Workaround: pass a scroll prop with a function element => element.scrollIntoView()

rimatla commented 5 years ago

@robatwilliams I'm on the same boat, could you pls post your workaround solution?

robatwilliams commented 5 years ago

I already did in the previous post.

To clarify, I'm referring to using this feature: https://github.com/rafrex/react-router-hash-link#scroll-function

rafgraph commented 5 years ago

This should be fixed now in v1.2.1