Skip to content

Commit

Permalink
🐛 Select the first tablist found in subtree instead of direct child
Browse files Browse the repository at this point in the history
  • Loading branch information
19h47 committed Jun 11, 2024
1 parent 248cc35 commit 7279a21
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export default class Tabs {
constructor(el: HTMLElement, options = {}) {
this.el = el;

// [role="tablist"] element has to be direct child of wrapper el
this.$tabList = [...this.el.children].find(panel => panel.getAttribute('role') === 'tablist') as HTMLElement;
this.$tabList = this.el.querySelector('[role="tablist"]') as HTMLElement;

this.options = { ...optionsDefault, ...options };

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@19h47/tabs",
"version": "8.0.0",
"version": "8.0.1",
"description": "Tabs",
"repository": {
"type": "git",
Expand Down

0 comments on commit 7279a21

Please sign in to comment.