From abc043b56b5fc1761243bfd5b68422a1b9b724f2 Mon Sep 17 00:00:00 2001 From: luisa-beerboom <101706784+luisa-beerboom@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:43:47 +0200 Subject: [PATCH] Fix scrolling table viewport resizing (#2812) --- .../scrolling-table/scrolling-table.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/app/ui/modules/scrolling-table/components/scrolling-table/scrolling-table.component.ts b/client/src/app/ui/modules/scrolling-table/components/scrolling-table/scrolling-table.component.ts index d146509acc..6d12e156fe 100644 --- a/client/src/app/ui/modules/scrolling-table/components/scrolling-table/scrolling-table.component.ts +++ b/client/src/app/ui/modules/scrolling-table/components/scrolling-table/scrolling-table.component.ts @@ -141,6 +141,8 @@ export class ScrollingTableComponent>> private _dataSource = new BehaviorSubject([]); private _dataSourceMap: Mapable> = {}; + private _oldDistTop = 0; + public constructor(private manageService: ScrollingTableManageService, private cd: ChangeDetectorRef) { super(); } @@ -228,6 +230,12 @@ export class ScrollingTableComponent>> if (this.cdkContainer) { const distTop = this.cdkContainer.nativeElement.getBoundingClientRect().top; + if (this._oldDistTop > distTop) { + setTimeout(() => { + this.scrollViewport?.checkViewportSize(); + }, 10); + } + this._oldDistTop = distTop; return `calc(100vh - ${distTop}px)`; }