Skip to content

Commit 04c4dae

Browse files
author
Marcell Toth
authored
fix: remove scrollbar-flicker (#153)
Makes the ScrollContainer 1px smaller than the available size. This mitigates the rounding errors that cause the flicker.
1 parent 194ad13 commit 04c4dae

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/ScrollContainer/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ const ScrollContainer = React.forwardRef<ScrollbarRefInstance, IScrollContainer>
142142
if (autosize) {
143143
return (
144144
<AutoSizer className="relative">
145-
{({ height, width }) => <div style={{ height, width }}>{ScrollElem}</div>}
145+
{({ height, width }) => (
146+
<div style={{ height: height - 1, width: width - 1 }} className="overflow-hidden">
147+
{ScrollElem}
148+
</div>
149+
)}
146150
</AutoSizer>
147151
);
148152
}

0 commit comments

Comments
 (0)