diff --git a/dist/cookcli-recipe-strategy.js b/dist/cookcli-recipe-strategy.js index 1bbd92f..0d114e0 100644 --- a/dist/cookcli-recipe-strategy.js +++ b/dist/cookcli-recipe-strategy.js @@ -386,72 +386,87 @@ class CookCliRecipeViewStrategy extends HTMLElement { class CookcliStrategyEditor extends HTMLElement { setConfig(config) { this._config = config; + if (this.isConnected) { + this._render(); + } } set hass(hass) { this._hass = hass; + if (this.isConnected) { + this._render(); + } } - // Méthode appelée quand l'utilisateur modifie un champ - _valueChanged(ev) { - if (!this._config || !this._hass) { + // Appelé automatiquement quand l'élément est inséré dans le DOM + connectedCallback() { + this._render(); + } + + _render() { + // On attend d'avoir hass avant de rendre : ha-textfield en a besoin + // pour son thème et ses styles. + if (!this._hass) { + this.innerHTML = `