Table: Fix state bug with initialRowIndex (#90308)

* fix: fix state bug

---------

Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
This commit is contained in:
Galen Kistler 2024-07-12 09:14:47 -05:00 committed by GitHub
parent da2962418d
commit 8400b54a53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,6 +81,9 @@ export const RowsList = (props: RowsListProps) => {
} = props; } = props;
const [rowHighlightIndex, setRowHighlightIndex] = useState<number | undefined>(initialRowIndex); const [rowHighlightIndex, setRowHighlightIndex] = useState<number | undefined>(initialRowIndex);
if (initialRowIndex === undefined && rowHighlightIndex !== undefined) {
setRowHighlightIndex(undefined);
}
const theme = useTheme2(); const theme = useTheme2();
const panelContext = usePanelContext(); const panelContext = usePanelContext();