Skip to content

Commit c555fd3

Browse files
avishainlidord-wix
authored andcommitted
not enable scroll if content is less than 1 pixel than it container (#1972)
* disable scroll for less than 1 pixel should prevent situations where a friction of pixel enables scroll and hence causes the scrollview-fader appear with no reason * change methodology to use Math.floor
1 parent 0adfc05 commit c555fd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commons/withScrollEnabler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function withScrollEnabler<PROPS, STATICS = {}>(WrappedComponent: React.Componen
2525
const layoutSize = useRef(0);
2626

2727
const checkScroll = useCallback(() => {
28-
const isScrollEnabled = contentSize.current > layoutSize.current;
28+
const isScrollEnabled = Math.floor(contentSize.current) > layoutSize.current;
2929
if (isScrollEnabled !== scrollEnabled) {
3030
setScrollEnabled(isScrollEnabled);
3131
}

0 commit comments

Comments
 (0)