fix race condition in declarative table (#15801)

This commit is contained in:
Alan Ren
2021-06-18 11:40:19 -07:00
committed by GitHub
parent 4c2f6eafe0
commit aeda95bb70
6 changed files with 24 additions and 8 deletions

View File

@@ -298,17 +298,18 @@ export default class DeclarativeTableComponent extends ContainerBase<any, azdata
this._data = finalData;
}
const newSelectedRow = properties.selectedRow ?? -1;
if (newSelectedRow !== this.selectedRow && properties.enableRowSelection) {
const previousSelectedRow = this.selectedRow;
super.setProperties(properties);
if (this.selectedRow !== previousSelectedRow && this.enableRowSelection) {
this.fireEvent({
eventType: ComponentEventType.onSelectedRowChanged,
args: {
row: properties.selectedRow
row: this.selectedRow
}
});
}
super.setProperties(properties);
}
public override clearContainer(): void {