From a01a4f00f609cfd516721cbc46179db3b0e88f5c Mon Sep 17 00:00:00 2001 From: Unemployed Capital <130201256+mdruuu@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:55:10 -0600 Subject: [PATCH] fixed getTabByRelPosition Currently, it's set at <= 0, which means going to previous tab from 2nd tab will result in an error, as it returns null. Changing it to < 0 fixes this issue. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 40a856f..3be4257 100644 --- a/src/index.ts +++ b/src/index.ts @@ -228,7 +228,7 @@ class TabGroup extends HTMLElement { getTabByRelPosition(position: number) { position = this.getActiveTab().getPosition() + position; - if (position <= 0) { + if (position < 0) { return null; } return this.getTabByPosition(position);