From a7bf31fe4900e942ab24b51461b6625f89ab3c16 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Fri, 6 Sep 2019 14:35:58 +0200 Subject: [PATCH] mgr/dashboard: Rendering datatable causes Angular runtime error Due some timing effects it might happen that the re-rendering of the datatable causes an Angular runtime error caused by changes outside Angulars' change-detection. Fixes: https://tracker.ceph.com/issues/41683 Signed-off-by: Volker Theile --- .../src/app/shared/datatable/table/table.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 125fb4e8153f..1d025c6a6ef9 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 @@ -325,7 +325,9 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O if (this.table && this.table.element.clientWidth !== this.currentWidth) { this.currentWidth = this.table.element.clientWidth; this.table.recalculate(); - window.dispatchEvent(new Event('resize')); + setTimeout(() => { + window.dispatchEvent(new Event('resize')); + }); } } -- 2.47.3