fbjs
fbjs copied to clipboard
Fixes broken scrollTop position
Else the scrollable.scrollHeight
will always be the same as the viewport.clientHeight
which causes the max scroll Y position to always be 0
(the top of the page).
Causes this issue.
I don't know about the other use cases but for this case the code would work if it was simplified down to just the below, as the scrollable
is the document.body
// viewport var removed
// ...
const xMax = scrollable.scrollWidth - scollable.clientWidth;
const yMax = scrollable.scrollHeight - scrollable.clientHeight;