From 479a625662beaa89a4a42bb200aa01bf2a196cce Mon Sep 17 00:00:00 2001 From: Piero <15440183+pierosavi@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:49:08 +0200 Subject: [PATCH] Update url on tab reorder (#18169) Co-authored-by: Bram Kragten --- src/panels/lovelace/hui-root.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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)); }