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

fix scrolledToBottom calculation #189

Merged
merged 2 commits into from
Nov 4, 2020
Merged

Conversation

ath92
Copy link
Contributor

@ath92 ath92 commented Nov 2, 2020

This fixes the scrolledToBottom calculation so that it also works when window is zoomed in/out. Zooming introduces rounding issues, which this PR fixes. This is related to #184.

Note that the original issue can easily be reproduced by going to https://virtuoso.dev/stick-to-bottom/ and changing the zoom level of the browser.

This is an alternative fix to #185, which was causing this function to return true even when not scrolled to the bottom for me.

I also added the playground files I used to test this change locally. Let me know if they should be removed for this PR to be merged. You can verify locally what this PR does by simply removing the change in scrolledToBottomEngine.ts; this should break the behaviour in the playground example.

@petyosi
Copy link
Owner

petyosi commented Nov 2, 2020

@ath92 @mahboubii - thanks for that. I will review thoroughly by the end of the week and merge.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants