fix: overview search bar scrolling behind header

This commit is contained in:
Rainer Killinger
2022-10-31 11:00:11 +01:00
parent bc13cc5e1f
commit a037090eec

View File

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