diff --git a/panels/config/automation/ha-automation-editor.html b/panels/config/automation/ha-automation-editor.html index 3cb59bfc8e..b2c8660ffd 100644 --- a/panels/config/automation/ha-automation-editor.html +++ b/panels/config/automation/ha-automation-editor.html @@ -166,20 +166,29 @@ class HaAutomationEditor extends window.hassMixins.EventsMixin(Polymer.Element) type: Boolean, observer: '_updateComponent', }, + + _rendered: { + type: Object, + value: null, + }, + + _renderScheduled: { + type: Boolean, + value: false, + }, }; } ready() { - super.ready(); this.configChanged = this.configChanged.bind(this); - this._rendered = null; - this._renderScheduled = false; + super.ready(); // This call will initialize preact. } disconnectedCallback() { super.disconnectedCallback(); if (this._rendered) { window.unmountPreact(this._rendered); + this._rendered = null; } } diff --git a/panels/config/script/ha-script-editor.html b/panels/config/script/ha-script-editor.html index 0b82213bfa..e9afc13c07 100644 --- a/panels/config/script/ha-script-editor.html +++ b/panels/config/script/ha-script-editor.html @@ -161,19 +161,24 @@ class HaScriptEditor extends window.hassMixins.EventsMixin(Polymer.Element) { type: Boolean, observer: 'isWideChanged', }, + + _rendered: { + type: Object, + value: null, + }, }; } ready() { - super.ready(); this.configChanged = this.configChanged.bind(this); - this._rendered = null; + super.ready(); // This call will initialize preact. } disconnectedCallback() { super.disconnectedCallback(); if (this._rendered) { window.unmountPreact(this._rendered); + this._rendered = null; } }