From a037090eec06e867a703b88a43620a74770287fe Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Mon, 31 Oct 2022 11:00:11 +0100 Subject: [PATCH] fix: overview search bar scrolling behind header --- .../modules/dashboard/dashboard.component.ts | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/app/modules/dashboard/dashboard.component.ts b/src/app/modules/dashboard/dashboard.component.ts index 940506fa..11b492d9 100644 --- a/src/app/modules/dashboard/dashboard.component.ts +++ b/src/app/modules/dashboard/dashboard.component.ts @@ -86,11 +86,6 @@ export class DashboardComponent implements OnInit, OnDestroy { }, }; - /** - * Offset from search bar to top - */ - searchToTopOffset = 0; - constructor( private readonly dataRoutingService: DataRoutingService, private scheduleProvider: ScheduleProvider, @@ -134,11 +129,6 @@ export class DashboardComponent implements OnInit, OnDestroy { ); } - ionViewDidEnter() { - this.searchToTopOffset = - this.searchRef.nativeElement?.getBoundingClientRect().top - 100; - } - async loadNextEvent() { const dataSeries = await this.scheduleProvider.getDateSeries( this.uuids, @@ -162,13 +152,6 @@ export class DashboardComponent implements OnInit, OnDestroy { } async onSearchBarFocus(_event: Event) { - this.ionContentRef.getScrollElement().then(element => { - if ( - element.scrollHeight - element.clientHeight >= - this.searchToTopOffset - ) { - this.ionContentRef.scrollToPoint(0, this.searchToTopOffset, 100); - } - }); + this.ionContentRef.scrollToTop(100); } }