diff --git a/src/panels/lovelace/editor/config-elements/hui-calendar-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-calendar-card-editor.ts index 5a7cd7049a..b9b736c783 100644 --- a/src/panels/lovelace/editor/config-elements/hui-calendar-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-calendar-card-editor.ts @@ -1,29 +1,29 @@ import { customElement, html, + internalProperty, LitElement, property, TemplateResult, - internalProperty, } from "lit-element"; +import { + array, + assert, + boolean, + object, + optional, + string, + union, +} from "superstruct"; import { fireEvent } from "../../../../common/dom/fire_event"; +import "../../../../components/entity/ha-entities-picker"; import type { HomeAssistant } from "../../../../types"; import type { CalendarCardConfig } from "../../cards/types"; import "../../components/hui-entity-editor"; -import "../../../../components/entity/ha-entities-picker"; import "../../components/hui-theme-select-editor"; import type { LovelaceCardEditor } from "../../types"; import type { EditorTarget, EntitiesEditorEvent } from "../types"; import { configElementStyle } from "./config-elements-style"; -import { - string, - optional, - object, - boolean, - array, - union, - assert, -} from "superstruct"; const cardConfigStruct = object({ type: string(), @@ -113,6 +113,7 @@ export class HuiCalendarCardEditor extends LitElement this._config = { ...this._config, entities: ev.detail.value }; } else if (target.configValue) { if (target.value === "") { + this._config = { ...this._config }; delete this._config[target.configValue!]; } else { this._config = {