diff --git a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatBody.tsx b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatBody.tsx index 3ff512898b..751f1ffc7b 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatBody.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatBody.tsx @@ -410,6 +410,7 @@ export const ChatBody = React.forwardRef { const unsubscribe = vanillaStore.subscribe(() => { @@ -426,6 +427,15 @@ export const ChatBody = React.forwardRef { + // @ts-ignore + if (filteredMessages.length > 0 && listRef?.current && !rerenderOnFirstMount.current) { + rerenderOnFirstMount.current = true; + // @ts-ignore + listRef.current.resetAfterIndex(0); + } + }, [listRef, filteredMessages]); + return filteredMessages.length === 0 ? ( ) : (