From: Volker Theile Date: Wed, 12 Aug 2020 14:25:05 +0000 (+0200) Subject: mgr/dashboard: Datatable catches select events from other datatables X-Git-Tag: v16.1.0~1314^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=31e9bbb9b308277d2f89390d5ff62f13457d69cb;p=ceph.git mgr/dashboard: Datatable catches select events from other datatables Ensure we do not process DOM 'select' events, see https://github.com/swimlane/ngx-datatable/issues/899. Fixes: https://tracker.ceph.com/issues/46903 Signed-off-by: Volker Theile --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts index 51259b27b16f..3744770a5393 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts @@ -696,8 +696,12 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O } onSelect($event: any) { - this.selection.selected = $event['selected']; - this.updateSelection.emit(_.clone(this.selection)); + // Ensure we do not process DOM 'select' events. + // https://github.com/swimlane/ngx-datatable/issues/899 + if (_.has($event, 'selected')) { + this.selection.selected = $event['selected']; + this.updateSelection.emit(_.clone(this.selection)); + } } toggleColumn(column: CdTableColumn) {