mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-06 06:58:21 +00:00
match the exact calls in TableBody to set the selected row. (#1808)
This commit is contained in:
parent
d2f313efe6
commit
acb14b84fc
1 changed files with 4 additions and 1 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue