]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Rendering datatable causes Angular runtime error 30209/head
authorVolker Theile <vtheile@suse.com>
Fri, 6 Sep 2019 12:35:58 +0000 (14:35 +0200)
committerVolker Theile <vtheile@suse.com>
Fri, 6 Sep 2019 12:35:58 +0000 (14:35 +0200)
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 <vtheile@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts

index 125fb4e8153f6debd64804ac6ab9a456de53164b..1d025c6a6ef94904dcab6658d79252a3fe6257ab 100644 (file)
@@ -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'));
+      });
     }
   }