diff --git a/src/app/calendar-app/calendar-app.component.html b/src/app/calendar-app/calendar-app.component.html index d539940ae..c59f415b7 100644 --- a/src/app/calendar-app/calendar-app.component.html +++ b/src/app/calendar-app/calendar-app.component.html @@ -198,7 +198,7 @@

Calendar Menu

- + diff --git a/src/app/calendar-app/calendar-app.component.scss b/src/app/calendar-app/calendar-app.component.scss index c56f1a8d7..f381c935d 100644 --- a/src/app/calendar-app/calendar-app.component.scss +++ b/src/app/calendar-app/calendar-app.component.scss @@ -31,3 +31,21 @@ padding: 16px; } } + +@media(min-width: 1025px) { + .calendarToolbar { + position: sticky; + top: 0; + z-index: 10; + } + + :host ::ng-deep { + .cal-month-view .cal-header, + .cal-week-view .cal-day-headers { + background-color: #fff; + position: sticky; + top: 64px; + z-index: 9; + } + } +} diff --git a/src/app/calendar-app/calendar-app.component.spec.ts b/src/app/calendar-app/calendar-app.component.spec.ts index e2b29af55..0363452f6 100644 --- a/src/app/calendar-app/calendar-app.component.spec.ts +++ b/src/app/calendar-app/calendar-app.component.spec.ts @@ -228,6 +228,13 @@ END:VCALENDAR expect(icon.style.color).toBe('pink'); }); + it('should mark the calendar toolbar for sticky positioning', () => { + fixture.detectChanges(); + + const toolbar = fixture.debugElement.nativeElement.querySelector('mat-toolbar.calendarToolbar'); + expect(toolbar).toBeTruthy(); + }); + it('should display events', () => { mockData['events'] = simpleEvents; component.calendarservice.syncCaldav(true);