Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes broken scrollTop position #130

Closed
wants to merge 1 commit into from
Closed

Fixes broken scrollTop position #130

wants to merge 1 commit into from

Conversation

AlastairTaft
Copy link

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

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
Copy link
Author

Causes this issue.

@AlastairTaft
Copy link
Author

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 AlastairTaft closed this by deleting the head repository Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants