Skip to content

Commit 3d12757

Browse files
committed
fix: scroll to bottom not always working
1 parent f2d4c70 commit 3d12757

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

package/src/components/MessageList/MessageFlashList.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,14 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
385385

386386
const [autoscrollToRecent, setAutoscrollToRecent] = useState(true);
387387

388+
useEffect(() => {
389+
if (autoscrollToRecent && flashListRef.current) {
390+
flashListRef.current.scrollToEnd({
391+
animated: true,
392+
});
393+
}
394+
}, [autoscrollToRecent]);
395+
388396
const maintainVisibleContentPosition = useMemo(() => {
389397
return {
390398
animateAutoscrollToBottom: true,

0 commit comments

Comments
 (0)