Make sure Table selected row is not set to undefined on mount (#2518)

This commit is contained in:
Hetu Nandu 2021-01-12 11:45:08 +05:30 committed by GitHub
parent 148497a1bc
commit 94cae231c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -353,7 +353,11 @@ class TableWidget extends BaseWidget<TableWidgetProps, WidgetState> {
filteredTableData: Array<Record<string, unknown>>,
selectedRowIndex?: number,
) => {
if (selectedRowIndex === undefined || selectedRowIndex === -1) {
if (
selectedRowIndex === undefined ||
selectedRowIndex === null ||
selectedRowIndex === -1
) {
const columnKeys: string[] = getAllTableColumnKeys(this.props.tableData);
const selectedRow: { [key: string]: any } = {};
for (let i = 0; i < columnKeys.length; i++) {