Skip to content

Commit 97840de

Browse files
committed
fix: height issue
1 parent e6e41ae commit 97840de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/StickyList.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ function StickyList(
1818
const innerRef = useRef();
1919
useEffect(() => {
2020
if (ref.current && follow && innerRef.current) {
21-
if (mode === 'bottom') {
21+
if (
22+
mode === 'bottom' &&
23+
innerRef.current.offsetHeight > ref.current.props.height
24+
) {
2225
ref.current.scrollTo(innerRef.current.offsetHeight);
2326
} else if (mode === 'top') {
2427
ref.current.scrollTo(0);

0 commit comments

Comments
 (0)