diff --git a/packages/main/src/components/AnalyticalTable/index.tsx b/packages/main/src/components/AnalyticalTable/index.tsx index f2681a484fc..0444bf6e1ee 100644 --- a/packages/main/src/components/AnalyticalTable/index.tsx +++ b/packages/main/src/components/AnalyticalTable/index.tsx @@ -282,11 +282,16 @@ const AnalyticalTable: FC = forwardRef((props: TableProps, ref: Ref< useEffect(() => { toggleAllRowsSelected(false); + const validChars = /^(\d\.)*\d$/; // eslint-disable-next-line guard-for-in for (const row in selectedRowIds) { - toggleRowSelected(row, selectedRowIds[row]); + if (reactTableOptions?.getRowId) { + toggleRowSelected(row, selectedRowIds[row]); + } else if (validChars.test(row)) { + toggleRowSelected(row, selectedRowIds[row]); + } } - }, [toggleRowSelected, toggleAllRowsSelected, selectedRowIds]); + }, [toggleRowSelected, toggleAllRowsSelected, selectedRowIds, reactTableOptions?.getRowId]); const calcRowHeight = parseInt( getComputedStyle(tableRef.current ?? document.body).getPropertyValue('--sapWcrAnalyticalTableRowHeight') || '44'