fix(planner): show border at top of plan view when scrolled on mobile

This commit is contained in:
Johannes Millan 2026-03-06 16:21:42 +01:00
parent 0a3444ad49
commit 370348a877
2 changed files with 17 additions and 0 deletions

View file

@ -4,6 +4,10 @@
overflow: auto;
display: flex;
height: 100%;
&.isScrolled {
border-top: 1px solid var(--extra-border-color);
}
}
.days {

View file

@ -66,6 +66,8 @@ export class PlannerPlanViewComponent {
}
});
this._setupScrollBorderDetection();
// Cleanup observers and timers on component destroy
this._destroyRef.onDestroy(() => {
this._intersectionObserver?.disconnect();
@ -145,6 +147,17 @@ export class PlannerPlanViewComponent {
this._pendingTimers.push(timer);
}
private _setupScrollBorderDetection(): void {
const host = this._elRef.nativeElement as HTMLElement;
const onScroll = (): void => {
host.classList.toggle('isScrolled', host.scrollTop !== 0);
};
host.addEventListener('scroll', onScroll, { passive: true });
this._destroyRef.onDestroy(() => {
host.removeEventListener('scroll', onScroll);
});
}
private _setupVisibleDayObserver(elements: readonly ElementRef[]): void {
this._visibleDayObserver?.disconnect();
this._visibleDayElements.clear();