Skip to content

Commit

Permalink
* tabs: support for switching tab with multi tabs with same id.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Nov 11, 2024
1 parent 6d86b8f commit 7663e8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tabs/src/vanilla/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export class Tabs extends Component<{}, {show: [target: string], shown: [target:
/* Add active class to panes. */
const target: string = $navItem.attr('href') || $navItem.data('target');
const name: string = $navItem.data('name') || target;
const $activePane = $(target);
const $tabsContainer = $nav.closest('.tabs');
const $activePane = $tabsContainer.length ? $tabsContainer.find(target) : $(target);
if (!$activePane.length) {
return;
}
Expand Down

0 comments on commit 7663e8d

Please sign in to comment.