trevorr / react-scroll-manager

Scroll position manager for React applications
ISC License
36 stars 13 forks source link

Bugfix for ScrollX / ScrollY in IE11 #3

Closed DonGissel closed 5 years ago

DonGissel commented 5 years ago

This PR replaces scrollX and scrollY with pageXOffset and pageYOffset (which is basically the same) to get scroll-compatibility in IE11. It does rename the properties in the local storage as well, but I don't know if this would be considered a breaking change for anyone?

See https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY#Notes for information about the cross-browser compatibility. pageXOffset is a safer bet. :)

DonGissel commented 5 years ago

Now the naming in local storage is unchanged from before, so there's full backwards compatibility. Woo!

trevorr commented 5 years ago

It looks like we made the same, non-disruptive change simultaneously. 😄 I merged mine with your comment above, so I'm closing this PR. Thanks for reporting the issue!