fbjs icon indicating copy to clipboard operation
fbjs copied to clipboard

Fixes broken scrollTop position

Open AlastairTaft opened this issue 8 years ago • 2 comments

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).

AlastairTaft avatar Mar 12 '16 13:03 AlastairTaft

Causes this issue.

AlastairTaft avatar Mar 12 '16 13:03 AlastairTaft

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;

AlastairTaft avatar Mar 12 '16 13:03 AlastairTaft