mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
fix(planner): show border at top of plan view when scrolled on mobile
This commit is contained in:
parent
0a3444ad49
commit
370348a877
2 changed files with 17 additions and 0 deletions
|
|
@ -4,6 +4,10 @@
|
|||
overflow: auto;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
|
||||
&.isScrolled {
|
||||
border-top: 1px solid var(--extra-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
.days {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue