match the exact calls in TableBody to set the selected row. (#1808)

This commit is contained in:
Mike Sawka 2025-01-23 13:46:29 -08:00 committed by GitHub
parent d2f313efe6
commit acb14b84fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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