diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index e9423fb81a..a15c499579 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -844,6 +844,9 @@ class HUIRoot extends LitElement { const oldIndex = this._curView as number; const newIndex = (this._curView as number) - 1; this._curView = newIndex; + if (!this.config.views[oldIndex].path) { + this._navigateToView(newIndex, true); + } lovelace.saveConfig(swapView(lovelace.config, oldIndex, newIndex)); } @@ -856,6 +859,9 @@ class HUIRoot extends LitElement { const oldIndex = this._curView as number; const newIndex = (this._curView as number) + 1; this._curView = newIndex; + if (!this.config.views[oldIndex].path) { + this._navigateToView(newIndex, true); + } lovelace.saveConfig(swapView(lovelace.config, oldIndex, newIndex)); }