Reset selected rows when table data is modified (#536)
This commit is contained in:
parent
4b37c97fa7
commit
2cb7c7be97
|
|
@ -333,9 +333,11 @@ class TableWidget extends BaseWidget<TableWidgetProps, WidgetState> {
|
|||
);
|
||||
}
|
||||
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<TableWidgetProps, WidgetState> {
|
|||
);
|
||||
}
|
||||
}
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user