Skip to content

Commit acb14b8

Browse files
authored
match the exact calls in TableBody to set the selected row. (#1808)
1 parent d2f313e commit acb14b8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

frontend/app/view/preview/directorypreview.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ function DirectoryTable({
342342
});
343343

344344
useEffect(() => {
345-
setSelectedPath((table.getSortedRowModel()?.flatRows[focusIndex]?.getValue("path") as string) ?? null);
345+
const topRows = table.getTopRows() || [];
346+
const centerRows = table.getCenterRows() || [];
347+
const allRows = [...topRows, ...centerRows];
348+
setSelectedPath((allRows[focusIndex]?.getValue("path") as string) ?? null);
346349
}, [table, focusIndex, data]);
347350

348351
useEffect(() => {

0 commit comments

Comments
 (0)