From: Volker Theile Date: Fri, 6 Sep 2019 12:35:58 +0000 (+0200) Subject: mgr/dashboard: Rendering datatable causes Angular runtime error X-Git-Tag: v15.1.0~1604^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30209%2Fhead;p=ceph.git 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 --- 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')); + }); } }