Skip to content
This repository was archived by the owner on Jul 10, 2022. It is now read-only.
This repository was archived by the owner on Jul 10, 2022. It is now read-only.

scrollTop/scrollHeight rounding discrepancies breaks preventParentScroll when display scaling is set. #71

Description

@Aaron-Pool

The issue here is pretty straight forward, on monitors that have any display scaling set (which I do, and I think it's pretty common, in the era of hdpi monitors), scrollTop can return a decimal value (see here). scrollHeight and `clientHeight on the other hand, always round to an integer (see here and here).

This results in an error where scrollTop is less than scrollDist, even though the scrollbar has reached the bottom. This is breaking preventParentScroll for me.

It's a super easy fix, and I'd be fine to do a PR if you're accepting them. Thanks!

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions