From 3fa6ffdec176b46afdfe9e15b115467c905a94fe Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Mon, 17 Feb 2025 13:20:18 -0500 Subject: [PATCH] scroll to top on page change --- client/stillbox/src/app/calls/calls.component.html | 2 +- client/stillbox/src/app/calls/calls.component.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/stillbox/src/app/calls/calls.component.html b/client/stillbox/src/app/calls/calls.component.html index ed1ca05..86ce14f 100644 --- a/client/stillbox/src/app/calls/calls.component.html +++ b/client/stillbox/src/app/calls/calls.component.html @@ -101,7 +101,7 @@
- +
(0)); @ViewChild('paginator') paginator!: MatPaginator; + @ViewChild('callsTable', { read: ElementRef }) callsTable!: ElementRef; count = 0; dialog = inject(MatDialog); page = 0; @@ -188,6 +189,9 @@ export class CallsComponent { setPage(p: PageEvent, force?: boolean) { this.selection.clear(); this.curPage = p; + if (this.callsTable) { + this.callsTable.nativeElement.scrollIntoView(true); + } if (p && p!.pageSize != this.perPage) { this.perPage = p!.pageSize; this.prefsSvc.set('callsPerPage', p!.pageSize);