From 5101d67f0ddfb333aeb9d9d7bf1eaf2cefa665ba Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Fri, 20 Sep 2024 14:10:17 +0300 Subject: [PATCH] UI: Apply angular zone on resize observer callback when necessary. --- .../attribute/attribute-table.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts b/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts index 41e9527a1d..32ceb8eb68 100644 --- a/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts +++ b/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts @@ -211,11 +211,13 @@ export class AttributeTableComponent extends PageComponent implements AfterViewI ngOnInit() { this.widgetResize$ = new ResizeObserver(() => { - const showHidePageSize = this.elementRef.nativeElement.offsetWidth < hidePageSizePixelValue; - if (showHidePageSize !== this.hidePageSize) { - this.hidePageSize = showHidePageSize; - this.cd.markForCheck(); - } + this.zone.run(() => { + const showHidePageSize = this.elementRef.nativeElement.offsetWidth < hidePageSizePixelValue; + if (showHidePageSize !== this.hidePageSize) { + this.hidePageSize = showHidePageSize; + this.cd.markForCheck(); + } + }); }); this.widgetResize$.observe(this.elementRef.nativeElement); }