mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 12:02:53 +00:00
fix: overview search bar scrolling behind header
This commit is contained in:
@@ -86,11 +86,6 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Offset from search bar to top
|
|
||||||
*/
|
|
||||||
searchToTopOffset = 0;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly dataRoutingService: DataRoutingService,
|
private readonly dataRoutingService: DataRoutingService,
|
||||||
private scheduleProvider: ScheduleProvider,
|
private scheduleProvider: ScheduleProvider,
|
||||||
@@ -134,11 +129,6 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ionViewDidEnter() {
|
|
||||||
this.searchToTopOffset =
|
|
||||||
this.searchRef.nativeElement?.getBoundingClientRect().top - 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
async loadNextEvent() {
|
async loadNextEvent() {
|
||||||
const dataSeries = await this.scheduleProvider.getDateSeries(
|
const dataSeries = await this.scheduleProvider.getDateSeries(
|
||||||
this.uuids,
|
this.uuids,
|
||||||
@@ -162,13 +152,6 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async onSearchBarFocus(_event: Event) {
|
async onSearchBarFocus(_event: Event) {
|
||||||
this.ionContentRef.getScrollElement().then(element => {
|
this.ionContentRef.scrollToTop(100);
|
||||||
if (
|
|
||||||
element.scrollHeight - element.clientHeight >=
|
|
||||||
this.searchToTopOffset
|
|
||||||
) {
|
|
||||||
this.ionContentRef.scrollToPoint(0, this.searchToTopOffset, 100);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user