diff --git a/dist/cookcli-recipe-strategy.js b/dist/cookcli-recipe-strategy.js index 82ab8a0..63f0478 100644 --- a/dist/cookcli-recipe-strategy.js +++ b/dist/cookcli-recipe-strategy.js @@ -405,7 +405,7 @@ class CookcliStrategyEditor extends HTMLElement { _render() { console.log("Editor render appelé", this._config, this._hass); - + // On attend d'avoir hass avant de rendre : ha-textfield en a besoin // pour son thème et ses styles. if (!this._hass) { @@ -415,51 +415,34 @@ class CookcliStrategyEditor extends HTMLElement { const c = this._config || {}; + // Remplacer temporairement ha-textfield par des inputs natifs this.innerHTML = `
- - - - - - - + + + +
`; - // On attache les écouteurs en JS natif, car la syntaxe @change de Lit - // n'est pas interprétée dans un innerHTML classique. + // Écouteurs natifs (change au lieu de input pour éviter les re-rendus intempestifs) this.querySelectorAll("[data-config-key]").forEach((champ) => { champ.addEventListener("change", (ev) => { const cle = ev.target.dataset.configKey; const nouvelleConfig = { ...this._config, [cle]: ev.target.value }; this._config = nouvelleConfig; - - // On notifie HA du changement : il met à jour la config du dashboard this.dispatchEvent( new CustomEvent("config-changed", { bubbles: true,