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() + } } }