Skip to content

Commit

Permalink
fix height issue calendar, make default on mobile list (#18394)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored Oct 25, 2023
1 parent f6fddbc commit a745539
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/panels/calendar/ha-full-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export class HAFullCalendar extends LitElement {

protected firstUpdated(): void {
this._loadCalendar(this.initialView);
this._activeView = this.initialView;
}

private async _loadCalendar(initialView: FullCalendarView) {
Expand Down Expand Up @@ -512,7 +513,7 @@ export class HAFullCalendar extends LitElement {
--ha-card-background,
var(--card-background-color, white)
);
min-height: 400px;
height: var(--calendar-height);
--fc-neutral-bg-color: var(
--ha-card-background,
var(--card-background-color, white)
Expand Down
1 change: 1 addition & 0 deletions src/panels/calendar/ha-panel-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class PanelCalendar extends LitElement {
.events=${this._events}
.calendars=${this._calendars}
.narrow=${this.narrow}
.initialView=${this.narrow ? "listWeek" : "dayGridMonth"}
.hass=${this.hass}
.error=${this._error}
@view-changed=${this._handleViewChanged}
Expand Down
4 changes: 4 additions & 0 deletions src/panels/lovelace/cards/hui-calendar-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard {
padding-inline-start: 8px;
direction: var(--direction);
}
ha-full-calendar {
--calendar-height: 400px;
}
`;
}
}
Expand Down

0 comments on commit a745539

Please sign in to comment.