Track horizontal scroll offset
aweary opened this issue · comments
We already track the vertical offset (pageYOffset
) so the perimeter is calculated correctly on scroll (and if the component mounts on a page that is already scrolled).
Horizontal scroll is less common, but still it's good idea to support it nonetheless.
Seems like pageYOffset is not finished, It looks like you need to recalculate initialOffset here