diff --git a/app/client/src/widgets/TableWidget.tsx b/app/client/src/widgets/TableWidget.tsx index ff0c45a34c..ef4ca184b5 100644 --- a/app/client/src/widgets/TableWidget.tsx +++ b/app/client/src/widgets/TableWidget.tsx @@ -333,9 +333,11 @@ class TableWidget extends BaseWidget { ); } componentDidUpdate(prevProps: TableWidgetProps) { - if ( + const tableDataUpdated = JSON.stringify(this.props.tableData) !== - JSON.stringify(prevProps.tableData) || + JSON.stringify(prevProps.tableData); + if ( + tableDataUpdated || JSON.stringify(this.props.filters) !== JSON.stringify(prevProps.filters) || this.props.searchText !== prevProps.searchText || @@ -359,6 +361,11 @@ class TableWidget extends BaseWidget { ); } } + if (tableDataUpdated) { + super.updateWidgetMetaProperty("selectedRowIndices", []); + super.updateWidgetMetaProperty("selectedRows", []); + super.updateWidgetMetaProperty("selectedRowIndex", -1); + } if (this.props.multiRowSelection !== prevProps.multiRowSelection) { if (this.props.multiRowSelection) { const selectedRowIndices = this.props.selectedRowIndex