Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
fixed getTabByRelPosition
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mdruuu authored Sep 4, 2023
1 parent 49525b8 commit a01a4f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a01a4f0

Please sign in to comment.