mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix schedule form rendering after disconnect (#18401)
This commit is contained in:
parent
763f80b46a
commit
b0b7e77e28
@ -93,6 +93,20 @@ class HaScheduleForm extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public disconnectedCallback(): void {
|
||||||
|
super.disconnectedCallback();
|
||||||
|
this.calendar?.destroy();
|
||||||
|
this.calendar = undefined;
|
||||||
|
this.renderRoot.querySelector("style[data-fullcalendar]")?.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
public connectedCallback(): void {
|
||||||
|
super.connectedCallback();
|
||||||
|
if (this.hasUpdated && !this.calendar) {
|
||||||
|
this.setupCalendar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public focus() {
|
public focus() {
|
||||||
this.updateComplete.then(
|
this.updateComplete.then(
|
||||||
() =>
|
() =>
|
||||||
@ -165,6 +179,10 @@ class HaScheduleForm extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected firstUpdated(): void {
|
protected firstUpdated(): void {
|
||||||
|
this.setupCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
private setupCalendar(): void {
|
||||||
const config: CalendarOptions = {
|
const config: CalendarOptions = {
|
||||||
...defaultFullCalendarConfig,
|
...defaultFullCalendarConfig,
|
||||||
locale: this.hass.language,
|
locale: this.hass.language,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user