From 987c81241ffbdacc6a8577f1d7fe371ae48b781d Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 20 Mar 2026 00:22:05 -0500 Subject: [PATCH] fix timeline scroll --- src/app/features/room/RoomTimeline.tsx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 87df29384..d79d21c62 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -214,20 +214,12 @@ export function RoomTimeline({ const processedEventsRef = useRef([]); const timelineSyncRef = useRef(null as unknown as typeof timelineSync); - const scrollToBottom = useCallback( - (behavior?: 'instant' | 'smooth') => { - if (!vListRef.current) return; - const lastIndex = processedEventsRef.current.length - 1; - if (lastIndex < 0) return; - - if (behavior === 'smooth' && !reducedMotion) { - vListRef.current.scrollToIndex(lastIndex, { align: 'end', smooth: true }); - } else { - vListRef.current.scrollTo(vListRef.current.scrollSize); - } - }, - [reducedMotion] - ); + const scrollToBottom = useCallback(() => { + if (!vListRef.current) return; + const lastIndex = processedEventsRef.current.length - 1; + if (lastIndex < 0) return; + vListRef.current.scrollTo(vListRef.current.scrollSize); + }, []); const timelineSync = useTimelineSync({ room,