From 9a50c0a49f769997cb3cc3e137b49fcfcdb7f39f Mon Sep 17 00:00:00 2001 From: Harshit Bansal Date: Tue, 24 Mar 2026 22:17:50 +0000 Subject: [PATCH] fix: prevent tab anchor from overriding non-tab URL hashes --- src/js/controllers/tabs_controller.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/tabs_controller.js b/src/js/controllers/tabs_controller.js index 19173ea..fe91a30 100644 --- a/src/js/controllers/tabs_controller.js +++ b/src/js/controllers/tabs_controller.js @@ -9,8 +9,11 @@ export default class extends Controller { this.data.get("inactiveTab") || "inactive" ).split(" ") if (this.anchor) { - this.index = this.tabTargets.findIndex((tab) => tab.id === this.anchor) - this.showTab() + const index = this.tabTargets.findIndex((tab) => tab.id === this.anchor) + if (index >= 0) { + this.index = index + this.showTab() + } } }