Skip to content

Commit

Permalink
Fix scrolling table viewport resizing (#2812)
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom authored Sep 27, 2023
1 parent 3cc6b64 commit abc043b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ export class ScrollingTableComponent<T extends Partial<Mutable<Identifiable>>>
private _dataSource = new BehaviorSubject<T[]>([]);
private _dataSourceMap: Mapable<DataSourceProvider<T>> = {};

private _oldDistTop = 0;

public constructor(private manageService: ScrollingTableManageService, private cd: ChangeDetectorRef) {
super();
}
Expand Down Expand Up @@ -228,6 +230,12 @@ export class ScrollingTableComponent<T extends Partial<Mutable<Identifiable>>>

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)`;
}

Expand Down

0 comments on commit abc043b

Please sign in to comment.