DominikSerafin/vuebar

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

Aaron-Pool opened this issue · 2 comments

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!

PR would be great @Aaron-Pool, thank you for reporting this