From f8adae0f6c5413c88e1a5a01486df279bc265e63 Mon Sep 17 00:00:00 2001 From: sawka Date: Wed, 22 Jan 2025 22:30:08 -0800 Subject: [PATCH] match the exact calls in TableBody to set the selected row. --- frontend/app/view/preview/directorypreview.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/app/view/preview/directorypreview.tsx b/frontend/app/view/preview/directorypreview.tsx index a58a77328f..9b951e40cb 100644 --- a/frontend/app/view/preview/directorypreview.tsx +++ b/frontend/app/view/preview/directorypreview.tsx @@ -342,7 +342,10 @@ function DirectoryTable({ }); useEffect(() => { - setSelectedPath((table.getSortedRowModel()?.flatRows[focusIndex]?.getValue("path") as string) ?? null); + const topRows = table.getTopRows() || []; + const centerRows = table.getCenterRows() || []; + const allRows = [...topRows, ...centerRows]; + setSelectedPath((allRows[focusIndex]?.getValue("path") as string) ?? null); }, [table, focusIndex, data]); useEffect(() => {