diff --git a/src/components/middle/MessageList.tsx b/src/components/middle/MessageList.tsx index 2bd8c5fa..45e31aa4 100644 --- a/src/components/middle/MessageList.tsx +++ b/src/components/middle/MessageList.tsx @@ -471,8 +471,11 @@ const MessageList: FC = ({ } else if (anchor) { const newAnchorTop = anchor.getBoundingClientRect().top; newScrollTop = scrollTop + (newAnchorTop - (anchorTopRef.current || 0)); - } else if (unreadDivider && !scrollOffset) { - newScrollTop = unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP); + } else if (unreadDivider) { + newScrollTop = Math.min( + unreadDivider.offsetTop - (hasTools ? UNREAD_DIVIDER_TOP_WITH_TOOLS : UNREAD_DIVIDER_TOP), + scrollHeight - scrollOffset, + ); } else { newScrollTop = scrollHeight - scrollOffset; }