From e069e2a9106faa9cd5f5999df04b7db05c2aa8d0 Mon Sep 17 00:00:00 2001 From: Jordan Rome Date: Mon, 27 Oct 2025 13:39:08 -0400 Subject: [PATCH] Fix issue with initial go-to-end There seems to be a race condition with react-window rendering rows and when the scroll handler gets called so introduce a small delay. --- src/components.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components.tsx b/src/components.tsx index 7050a7d..c89b203 100644 --- a/src/components.tsx +++ b/src/components.tsx @@ -1604,13 +1604,16 @@ export function MainContent({ verifierLogState.cSourceMap.logLineToCLine.get( verifierLogState.lastInsIdx, ) || ""; - setSelectedAndScroll( - verifierLogState.lastInsIdx, - "", - visualIdx, - cLineIdToVisualIdx.get(clineId) || 0, - ); - }, [verifierLogState]); + setTimeout(function () { + setSelectedAndScroll( + verifierLogState.lastInsIdx, + "", + visualIdx, + cLineIdToVisualIdx.get(clineId) || 0, + "", + ); + }, 500); + }, [verifierLogState, logListRef]); const depArrowState: DepArrowState = useMemo(() => { const arrowState = {