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