React does it like this:
return {
x: window.pageXOffset || document.documentElement.scrollLeft,
y: window.pageYOffset || document.documentElement.scrollTop
};
We should probably do the same! Would you like to make a PR?
Sure, sounds good! Do you think a test makes sense? Seems like most tests were pure logic, not DOM.
I don't know @rpflorence's stance on this but since it's a one-off thing, not related to logic and React already has a “reference implementation”, IMO fixing it and adding a link to relevant React source code piece should be enough. Can't be sure though!
Most helpful comment
React does it like this:
We should probably do the same! Would you like to make a PR?