Skip to content

Commit eb561af

Browse files
committed
fix: add improvements to scrolling
1 parent 5da09e3 commit eb561af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package/src/components/MessageList/MessageFlashList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
457457
* If such a case arises, we scroll to bottom.
458458
*/
459459
const isMessageRemovedFromMessageList =
460-
messageListLengthAfterUpdate < messageListLengthBeforeUpdate.current;
460+
messageListLengthBeforeUpdate.current - messageListLengthAfterUpdate === 1;
461461

462462
/**
463463
* Scroll down when
@@ -484,6 +484,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
484484
if (channel.countUnread() > 0) {
485485
markRead();
486486
}
487+
setAutoScrollToRecent(false);
487488
}, WAIT_FOR_SCROLL_TIMEOUT);
488489
}
489490
};

0 commit comments

Comments
 (0)