From 6c80e2ef7bac77cdded689a75653f6f6746b3afb Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Wed, 12 Aug 2020 16:25:05 +0200 Subject: [PATCH] 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 (cherry picked from commit 31e9bbb9b308277d2f89390d5ff62f13457d69cb) --- .../src/app/shared/datatable/table/table.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 9efb7c91915..c2fe650da76 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 @@ -681,8 +681,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($event: any) { -- 2.47.3