We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 139aca2 commit a0caa22Copy full SHA for a0caa22
1 file changed
packages/elements/src/tab-bar/index.ts
@@ -457,7 +457,10 @@ export class TabBar extends BasicElement {
457
const tabList = this.getFocusableTabs();
458
if (tabList && tabList.length > 0) {
459
const focusedTabIndex = tabList.findIndex((tab) => tab.active);
460
- this.rovingTabIndex(tabList[focusedTabIndex], tabList);
+ // Handle an edge case in which there is no tab with truthy active prop.
461
+ // There is a report that this happens on UI framework such as Angular.
462
+ const safeIndex = Math.max(focusedTabIndex, 0);
463
+ this.rovingTabIndex(tabList[safeIndex], tabList);
464
}
465
466
0 commit comments