Skip to content

Commit

Permalink
fix: remove scrollbar-flicker (#153)
Browse files Browse the repository at this point in the history
Makes the ScrollContainer 1px smaller than the available size.
This mitigates the rounding errors that cause the flicker.
  • Loading branch information
Marcell Toth authored Apr 29, 2020
1 parent 194ad13 commit 04c4dae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ScrollContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ const ScrollContainer = React.forwardRef<ScrollbarRefInstance, IScrollContainer>
if (autosize) {
return (
<AutoSizer className="relative">
{({ height, width }) => <div style={{ height, width }}>{ScrollElem}</div>}
{({ height, width }) => (
<div style={{ height: height - 1, width: width - 1 }} className="overflow-hidden">
{ScrollElem}
</div>
)}
</AutoSizer>
);
}
Expand Down

0 comments on commit 04c4dae

Please sign in to comment.