Skip to content

Commit 350a99a

Browse files
committed
fix: auto scroll when needed
1 parent b697372 commit 350a99a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

package/src/components/MessageList/MessageFlashList.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,11 @@ const MessageListFlashListWithContext = (props: MessageListFlashListPropsWithCon
468468

469469
useEffect(() => {
470470
const handleEvent = (event: Event) => {
471-
if (event.message?.user?.id === client.userID) {
472-
setAutoScrollToRecent(true);
473-
} else {
471+
if (event.message?.user?.id !== client.userID) {
474472
if (!scrollToBottomButtonVisible) {
475-
setAutoScrollToRecent(true);
473+
flashListRef.current?.scrollToEnd({
474+
animated: true,
475+
});
476476
} else {
477477
setAutoScrollToRecent(false);
478478
}

0 commit comments

Comments
 (0)