Skip to content

Commit 1c36e65

Browse files
committed
scroll when already at bottom and new message arrives
- Updated scroll logic in MessagesList component - Now scrolls for new messages if user is at bottom or sender is self - Excludes reaction messages from auto-scroll behavior
1 parent 3a1c352 commit 1c36e65

File tree

1 file changed

+1
-1
lines changed
  • frontend/src/components/MessagesList

1 file changed

+1
-1
lines changed

frontend/src/components/MessagesList/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ const MessagesList = ({ ticket, ticketId, isGroup, markAsRead, readOnly }) => {
702702
const isAtBottom = scrollTop + clientHeight >= (scrollHeight - clientHeight / 4);
703703
message.bottomStick = !isAtBottom && !message.fromMe || undefined;
704704
dispatch({ type: "ADD_MESSAGE", payload: message });
705-
if (data.message.fromMe && data.message.mediaType !== "reactionMessage") {
705+
if ((isAtBottom || data.message.fromMe) && data.message.mediaType !== "reactionMessage") {
706706
scrollToBottom();
707707
}
708708
if (message.bottomStick) {

0 commit comments

Comments
 (0)