diff --git a/src/components/LogDataTable.tsx b/src/components/LogDataTable.tsx index 64833b0a0..6c17eb76c 100644 --- a/src/components/LogDataTable.tsx +++ b/src/components/LogDataTable.tsx @@ -313,6 +313,15 @@ export function LogDataTable({ } }, [currentPage, table, isServerPagination]); + // Collapse any expanded rows whenever the page changes, since row ids + // are reused across pages and would otherwise show the wrong content + // in the same expanded position. + const pageIndex = table.getState().pagination.pageIndex; + useEffect(() => { + setExpandedRows(new Set()); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [pageIndex]); + const handleTabChange = (value: string) => { if (disabled) return;