mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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() {
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
@ -165,6 +179,10 @@ class HaScheduleForm extends LitElement {
|
||||
}
|
||||
|
||||
protected firstUpdated(): void {
|
||||
this.setupCalendar();
|
||||
}
|
||||
|
||||
private setupCalendar(): void {
|
||||
const config: CalendarOptions = {
|
||||
...defaultFullCalendarConfig,
|
||||
locale: this.hass.language,
|
||||
|
Loading…
x
Reference in New Issue
Block a user