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(() => {