You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To compute the width of a scrollbar, SimpleBar uses the scrollbarwidth library, which takes offsetWidth - clientWidth of a div with a scrollbar. Since offsetWidth and clientWidth are rounded to integers and the scrollbar width isn’t always an integer at some non-default browser zoom levels, this sometimes results in weird one-pixel layout gaps.
This test case consists of red SimpleBar divs of random widths on a blue background. When rendered at certain zoom levels, white gaps are visible on the right edges of some or all of the red divs. Chrome at 200% is an especially bad case:
I sent a fix upstream to unmaintain/scrollbarWidth#2, but I’m not sure if the maintainer is active, so we may want to pull in the fixed scrollbarWidth function ourselves.
Additional context
Your environment
Software
Version(s)
SimpleBar
4.0.0-alpha.9
Browser
Chrome 75
Operating System
Ubuntu 19.04
The text was updated successfully, but these errors were encountered:
Current Behavior
To compute the width of a scrollbar, SimpleBar uses the
scrollbarwidth
library, which takesoffsetWidth - clientWidth
of adiv
with a scrollbar. SinceoffsetWidth
andclientWidth
are rounded to integers and the scrollbar width isn’t always an integer at some non-default browser zoom levels, this sometimes results in weird one-pixel layout gaps.This test case consists of red SimpleBar
div
s of random widths on a blue background. When rendered at certain zoom levels, white gaps are visible on the right edges of some or all of the reddiv
s. Chrome at 200% is an especially bad case:Expected behavior
There should be no white gaps.
Reproducible example
https://jsfiddle.net/anderskaseorg/bhoqt7kc/
Suggested solution(s)
I sent a fix upstream to unmaintain/scrollbarWidth#2, but I’m not sure if the maintainer is active, so we may want to pull in the fixed
scrollbarWidth
function ourselves.Additional context
Your environment
The text was updated successfully, but these errors were encountered: