From 8400b54a53ddb6586785cd4634de9cd388634a8b Mon Sep 17 00:00:00 2001 From: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com> Date: Fri, 12 Jul 2024 09:14:47 -0500 Subject: [PATCH] Table: Fix state bug with initialRowIndex (#90308) * fix: fix state bug --------- Co-authored-by: nmarrs --- packages/grafana-ui/src/components/Table/RowsList.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/grafana-ui/src/components/Table/RowsList.tsx b/packages/grafana-ui/src/components/Table/RowsList.tsx index c5bb9ae817a..9ee3ca8baf3 100644 --- a/packages/grafana-ui/src/components/Table/RowsList.tsx +++ b/packages/grafana-ui/src/components/Table/RowsList.tsx @@ -81,6 +81,9 @@ export const RowsList = (props: RowsListProps) => { } = props; const [rowHighlightIndex, setRowHighlightIndex] = useState(initialRowIndex); + if (initialRowIndex === undefined && rowHighlightIndex !== undefined) { + setRowHighlightIndex(undefined); + } const theme = useTheme2(); const panelContext = usePanelContext();