Skip to content

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/modules/Channel/components/MessageList/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ const MessageList: React.FC<MessageListProps> = ({
291291
time={unreadSince}
292292
lastReadAt={unreadSinceDate}
293293
onClick={() => {
294-
if (scrollRef?.current) scrollRef.current.scrollTop = Number.MAX_SAFE_INTEGER;
294+
if (scrollRef?.current) scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
295295
if (!disableMarkAsRead && !!currentGroupChannel) {
296296
markAsReadScheduler.push(currentGroupChannel);
297297
messagesDispatcher({

src/modules/Channel/context/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const scrollIntoLast = (
4040
}
4141
try {
4242
const scrollDOM = scrollRef?.current || document.querySelector('.sendbird-conversation__messages-padding');
43-
scrollDOM.scrollTop = Number.MAX_SAFE_INTEGER;
43+
scrollDOM.scrollTop = scrollRef.current.scrollHeight;
4444
setIsScrolled?.(true);
4545
} catch (error) {
4646
setTimeout(() => {

0 commit comments

Comments
 (0)